Mygntay
Mygntay

Reputation: 45

Questions regarding directed association link in class diagram

I have three questions on directed association link inside a class diagram. here is a screenshot of what i did. i am using modelio.

Description of screenshot: The screenshot shows a class "Dress" linked by a directed association link to an enumeration named "TypeOfClothes".

enter image description here

here are my questions:

1: When two class or a class and an enumeration are linked together with a directed association link like here what does the multiplicity under the none arrowhead part of the association means ?

2: From what I understand, the attribute above the association means the same thing as the attribute under the class typeOfDress. however there is no attribute created in the model when given only with association. Am i wrong somewhere ?

3: If I had an attribute given on the none arrowhead side of the association what would that means ?

I hope it's understandable, if not, please tell me what I can improve :) Thank you for your help and have a nice day!

Upvotes: 1

Views: 378

Answers (1)

bruno
bruno

Reputation: 32594

1: When two class or a class and an enumeration are linked together with a directed association link like here what does the multiplicity under the none arrowhead part of the association means ?

the fact the relation is not navigable from TypeOfClothes to Dress does not imply it is not possible to have a restriction on the number of instances of Dress associated to TypeOfClothes. So the multiplicity is given and being here * that means any number from 0.

2: From what I understand, the attribute above the association means the same thing as the attribute under the class typeOfDress. however there is no attribute created in the model when given only with association. Am i wrong somewhere ?

it is legal to show both an association and an attribute having the same name in the class diagram, even this is redundant and only one of them is enough. From the standard formal/2017-12-05 page 206 :

Figure 11.31 shows that the attribute notation can be used for an Association end owned by a Class, because an Association end owned by a Class is also an attribute. Although it would typically be suppressed on grounds of redundancy, this notation may be used in conjunction with the association notation to make it perfectly clear that the attribute is also an Association end.

An attribute is an owned property, so if your class own the property you have the attribute even you do not mention it in the attribute compartment

3: If I had an attribute given on the none arrowhead side of the association what would that means ?

the relation is not navigable in that direction, so if you add a name near * it is just informative, it is not a property of TypeOfClothes, so better to not have it


Out of that typeOfDress is public because of the +, are you sure you want that ?

Upvotes: 1

Related Questions