Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML composition attributes not feature in the class?

Tags:

oop

uml

I have a class A and it has data members of class B and class C which are composition relationships. As I am going to draw a composition relationship line from B to A and C to A, does this mean I cannot also include the data members within the class A "box" because the relationship is inferred from the composition relationship lines?

I ask because the data member variable names seem a good way to help understand the context and this cannot be represented if you omit the data members from the class A "box"??

I am not sure if there is a cast-iron rule in UML or whether I am free to choose. This is not for auto-generation of code- just human reading.

like image 521
user997112 Avatar asked Jan 20 '26 15:01

user997112


1 Answers

At least, in UML you can show a name of each property like a figure below.

enter image description here

like image 53
Satomi Avatar answered Jan 23 '26 21:01

Satomi