In a UML class diagram, can composition be bidirectional?

Can a composition be bi-directional so that both classes know about each other?

And if not, what is the default direction of the composition?

+4
source share
3 answers

Yes, the composition does not add limitations to the navigation ability of the association. More information on the differences between Accociation, Composition and Aggregations can be found here: UML Composition vs Aggregation vs Association

+3
source

You must distinguish between shipping and aggregation. Arrow and diamond.

A- > B , B A. A B, ,

().

( OMG TM (OMG UML) - .109)

, ?

. .

, , B , A . , . , , UML, . . .

? ?

, , , B , A B.

, shared aggregation ( ) , , UML.

+4

https://www.lucidchart.com/pages/uml/class-diagram:

. . Car RoadTrip . "assignCar" 0..1, , RoadTrip , , , . , RoadTrip , , Caravan 0.. *. Car "getRoadTrip", , - 0.. *

0
source

All Articles