I am just starting with UML (StarUML 5) so please excuse this really basic question.
Let's say a Person has multiple Characteristics, each of which has a Name and a Value. (This is just to keep things simple.) Suppose I create the Characteristic
class accordingly.
I want to generate Java class Person
with a property something like ArrayList(Characteristic)
.
Should I add an attribute to the Person
class like ArrayList(Characteristic)
, or should I just use an Aggregation relationship between Person
and Characteristic
and specify the multiplicity as 0..* ?
On the first (ArrayList) approach I don't even model the multiplicity. On the second (Aggregation) approach the Java code creates a property in Person
of type Characteristic
but not a "List-like" property, i.e. it ignores the multiplicity in the diagram.
Thank you.