When to use an attribute (property) instead of an association/aggregation/composition when drawing a UML
问题 Okay so I'm a bit confused as to when I should add an attribute to a class vs drawing an association to a class when trying to show a relationship in a UML diagram. For example let's say I have a DFA class that contains 10 state objects each having a different set of paths to various states in the DFA. Should I draw the composition line from the DFA to the State class or just type all 10 states in the attribute section of the DFA class. Basically I'm trying to figure out if when a Class A