Book a Demo

Author Topic: Setter methods not visible from property dialog  (Read 3374 times)

ajaxx

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Setter methods not visible from property dialog
« on: October 21, 2005, 06:51:40 am »
I just noticed something that you might want to be aware of.  Its easy enough to work around.  I am working with a model I opened a class Volume.  In it I made an attribute as follows:

m_quantity : uint

The language binding for the class is C#.  I click on the attribute and then selected the property checkbox.  It brought up a window with the following items:

Name: [ box ]
Getter: [ box ]
<blank space>
Stereotype: <Greyed>
Get Scope: [Public] Set Scope: <disabled>
Read and Write checkboxes both checked.

However, I cant get this thing to expose a public setter property.  Any idea why these would magically disappear from me?

-- Aj

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Setter methods not visible from property dialo
« Reply #1 on: October 21, 2005, 03:19:13 pm »
Quote
[size=13][SNIP][/size]

However, I cant get this thing to expose a public setter property.  Any idea why these would magically disappear from me?

-- Aj
Hi Aj,

It's a bug - Although EA doesn't give you access to the accessor methods, it should still show them.   Formally report it... to the Sparx support email address: [email protected].

You might find my recent research on Properties (particularly Microsoft languages) and documented in :  [size=13]Property Redux[/size] interesting.

HTH,

Paolo
« Last Edit: October 21, 2005, 03:58:02 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Setter methods not visible from property dialo
« Reply #2 on: October 23, 2005, 04:43:18 pm »
Hello Aj,

What's happening is that for C# (and VB.Net) the two are methods are encapsulated into one property, with get and set parts.  EA is allowing you to set the scope of the property and you can check or uncheck the Read and Write components of the property as you desire.

Hope that helps.
« Last Edit: October 23, 2005, 04:43:30 pm by simonm »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Setter methods not visible from property dialo
« Reply #3 on: October 23, 2005, 05:01:40 pm »
Quote
Hello Aj,

What's happening is that for C# (and VB.Net) the two are methods are encapsulated into one property, with get and set parts.  EA is allowing you to set the scope of the property and you can check or uncheck the Read and Write components of the property as you desire.

Hope that helps.
Simon,
I understand this.  I think Ajaxx does also.  Our point is; in the case of C# according to your explanation, you shouldn't provide the getter syntax in the read only text box.  If you show the getter, you should also show the setter.
Consistency, Consistency, Consistency! TM

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!