Book a Demo

Author Topic: why C# setter property is not available?  (Read 4074 times)

wozoi

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
why C# setter property is not available?
« on: July 11, 2004, 11:37:50 am »
hello,

I discovered EA from two days, and I am very impressend of the ease I have to work with.

I have observed in clas diagram, with the "create property implementation" using C# language that the Setter field is unavailable? Why?

I will soon try the code generation and then the mdg link for vs.net hopping it's still so easy.If so, I will forget my Xde to have EA.

syncerly,

pierre jean

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: why C# setter property is not available?
« Reply #1 on: July 11, 2004, 04:33:51 pm »
In C# there is no separate signature declaration for getters and setters.  As in:

Code: [Select]

public train Newt {
     get{
           return new;
     }
     set{
           new = value;
     }
}

Therefore there is no need for EA to supply a separate suignature.

hth
Bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

wozoi

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: why C# setter property is not available?
« Reply #2 on: July 11, 2004, 10:15:12 pm »
ok,

And what to do when you only want one of them ? the getter for example.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: why C# setter property is not available?
« Reply #3 on: July 11, 2004, 11:09:00 pm »
Quote
And what to do when you only want one of them ? the getter for example.


Make it read-only (or write-only if you only want the setter).
The Sparx Team
[email protected]

wozoi

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: why C# setter property is not available?
« Reply #4 on: July 12, 2004, 12:08:12 am »
GREAT!

thanks for your celerity.

I have another question, it's about code generation. Is it possibile to define specific template for specific project.

For example having a class generation template specific for the DAL and another one for the BLL.

In a past projectwe used Decorator pattern to handle the DAL object. This decorator returned the business object Interface. With this kind of implementation it would be cool to design the business objects model and when generation occure having the Interfaces and then the decorators classes generated.

And if yes, is there a way to regroup personnal project templates to not corrupt the basics EA templates.

sincerly,
pierre jean