- attributes and fields - 1 Update
Agostino <sc.ag...@gmail.com>: Apr 04 07:35AM -0700
I've got two questions about attributes of classes in class diagrams.
The first is: does an UML attribute map exactly to a class field?
The second is somewhat related to the concept of field; in some languages
(C#) we have the concept of property. This is just an hidden couple of
methods that mimic the field syntax while offering the setter/getter
benefit for additional logic. This corresponds to setXXX getXXX methods in
java.
Now, should a property be considered an operation, following their nature
of methods or an attribute following its similarity to fields?
Maybe the answer could be 'it depends'? A formally correct way would be the
first, while at the same time this representation in some cases could be
too informative, showing details not relevant for the model.
This is, sometimes I want to know that the property "Height" is backed by a
private field height, sometimes it's obvious or irrelevant and this would
simply pollute the class description with irrelevant information. In this
second case I include it in the attributes, knowing that is not
implementation accurate (a property can be virtual, can execute additonal
logic etc.etc.)
What are you thoughts about this?
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to umlforum+u...@googlegroups.com.