Reputation: 27
Let us say we have Class A, Class B, and Class C
Class A has an object of Class B: array = ArraList
Class A then passes this array to Class C
When drawing the class diagram
which logic is the correct one:
Class A has an association with Class B and Class B, and Class C has a dependency with Class B
OR
Class A has an association with Class B, Class C has an association with Class A, and Class C has a dependency with Class B
Or are the both wrong? If so, what is the correct way of representing the following case in a class diagram?
Upvotes: 0
Views: 447
Reputation: 32586
Class A has an object of Class B: array = ArraList
I suppose you mean Class A has the attribute 'array' being an 'ArrayList' of Class B, so ArrayList<B> array;
Class A has an association with Class B and Class B, ...
I suppose is Class A has an association with Class B, ...
Class A then passes this array to Class C
I suppose you mean this array is given in argument to an operation of Class C
Class A has an association with Class B, and Class C has a dependency with Class B
Class A has an association with Class B, Class C has an association with Class A, and Class C has a dependency with Class B
Upvotes: 2