Re: [UML Forum] Digest for umlforum@googlegroups.com - 1 update in 1 topic

17 views
Skip to first unread message

Jarek Zelinski

unread,
Apr 5, 2021, 10:11:39 PM4/5/21
to umlf...@googlegroups.com
Generally, object paradigm means objects working together and objects have features like attributes and operations (behavior).  I think term fields you got from the relational paradigm. As second: "class" on the UML diagram we use for conceptual model (notions) or architecture model. As we talk about coding we mean architecture (code structure).

get/set is one of the worst manners in object paradigm (see this: https://martinfowler.com/bliki/TellDontAsk.html)

Generally in the object paradigm lots of time we use the attribute as "parts", especially when we use (build) aggregates.  Be careful because of each language (java, C#, C++, e.t.c.) is a little different implementation of the object paradigm. We use UML for PIM  (Platform Independent Models), remember that ;) 


On Mon, 5 Apr 2021 at 18:54, <umlf...@googlegroups.com> wrote:
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.


--
--
Jarek Zelinski


Reply all
Reply to author
Forward
0 new messages