0

Assume that:

  • Class A has a collection of Class B (aggregation/composition)
  • Class C accesses the interface of Class A to obtain specific instances of Class B
  • Class C manipulates/uses the interface of Class B instances it gets

It follows that without a doubt, Class C has a relation with Class A. However one question remains: Should a relation be mapped from class C to class B, and why?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Philippe Hebert
  • 1,616
  • 2
  • 24
  • 51

1 Answers1

1

Yes, you should have the usual association (arrow) from C to B. Because having association means C have navigation from C to B.

As C can manipulate with B instances, the navigation from C to B also exists, and the back arrow is also necessary.

As the association works both-side, both arrows should not be shown. The contemporary UML standard does not use drawing of two-sided arrows.

If C has also fields (not local variables!) of type B, the C-B line should have the point on the B end. The same for the back direction. Look for examples here

Community
  • 1
  • 1
Gangnus
  • 24,044
  • 16
  • 90
  • 149