UML association vs. composition and detail level

前端 未结 4 1542
北荒
北荒 2020-12-04 20:21

Actually, make that a couple of amateur UML questions! When creating a UML diagram to model some domain concepts and you come across a domain concept that \"holds\" some inf

4条回答
  •  旧巷少年郎
    2020-12-04 20:49

    Association :
    It means two classes have some kind of relationship, could be anything really.
    E.g : A uses B, A is related to B in a given way.

    Composition :
    This is also a special type of association used for modelling 'Ownership'. This is very similar to Aggregation with the only difference that it depicts a Whole-part relationship and the 'part' entity doesn't have its own independent existence

    E.g : A consists of B; B is a part of A and hence cannot exist without A.

    Good explanation : UML Class Diagram: Association, Aggregation and Composition

提交回复
热议问题