jfeliu007 / goplantuml

PlantUML Class Diagram Generator for golang projects
MIT License
1.77k stars 166 forks source link

Composition diamond at wrong association end #121

Open fractalqb opened 2 years ago

fractalqb commented 2 years ago

In your example MyStruct1 is a part of MyStruct2. In particular the lifetime of MyStruct1 instances that are associated that way to MyStruct2 instances depends on the lifetime of the MyStruct2 instance. This make the association a composition where MyStruct2 is the composite and MyStruct1 is the component. For a composition the filled diamond is at the association end that touches the composite. I.e. in PlantUML MyStruct2 *-- MyStruct1. Take the example from the UML specification v2.5.1; Figure 11.5 showing a class "Car" and a class "Wheel". There the diamond is at the Car.