3

I know the differences between these associations (as described here). However I'm wondering:

  • Composition, why not simply use an association with multiplicity of 1..* (and thus implicit saying that the target class has to exist).
  • Aggregation, actually using multiplicity here too

Or am I wrong here and do these associations all (and only) have to do with the "strength" of the association?

6

UML is not one of these mathematical computation models that try to achieve completeness with a minimal set of rules(like Turning machines or lambda calculus). UML is a visualization of software architecture and flow. It is not used for proving - it is used for understanding.

Yes, using 1..* forces a child to exist for the duration of it's parent's lifetime(though one may argue that it allows to replace children), but does it convey the meaning?

Associations and compositions have different meanings, and are used for different things. Associations are connections between separate entities. Compositions are nested components/data structures. Bundling them together may make the core set of rules simpler - at the expense of obscuring the diagrams.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.