Association, Aggregation, Composition and Dependency
Association vs. Dependency
Association
Association的定义:
描述两个类之间的结构关系:一个类的实例连接到另一个类的实例
An association is a structural relationship between classes that specifies that objects
of one class are connected to objects of another class。
#严格的说,An association represents a structural relationship that connects two classifiers
通常也可以用class泛指其他3类。
Classifiers: class、interface、data type、component。
Association有5种类型:
1. Bi-directional:
2. Uni-directional associations:
3. Association class:
4. aggregation(Basic aggregation):
5. Composition (Composition aggregation)
Reflexive associations
Association举例:
Bi-directional:
Association class:
Dependency
Dependency的定义:(From UML Spec)
A dependency signifies a supplier/client relationship between model elements where the modification of the supplier may impact the client model elements. A dependency implies the semantics of the client is not complete without the supplier. The presence of dependency relation