深入理解UML中的依赖和关联

An Association implies two model elements have a relationship,usually implemented as an instance variable in one Class. This connector can include named roles at each end,multiplicity,direction and constraints. Association is the general relationship type between elements. To connect more than two elements in an association,you can use the N-Ary Association element.

When code is generated for Class diagrams,Associations become instance variables in the target Class. The relationship is also used in Package,Object,Communication, Data Modeling and Deployment diagrams.

Dependency relationships are used to model a wide range of dependent relationships between model elements in Use Case, Activity and Structural diagrams,and even between models themselves. You can create the Dependency from the Common page of the Enterprise Architect UML Toolbox. The Dependencies package as defined in UML 2.1 has many derivatives,such as Realization, Deployment and Use. Once you create a Dependency you can further refine its meaning by applying a specialized stereotype.

相关文章

什么是设计模式一套被反复使用、多数人知晓的、经过分类编目...
单一职责原则定义(Single Responsibility Principle,SRP)...
动态代理和CGLib代理分不清吗,看看这篇文章,写的非常好,强...
适配器模式将一个类的接口转换成客户期望的另一个接口,使得...
策略模式定义了一系列算法族,并封装在类中,它们之间可以互...
设计模式讲的是如何编写可扩展、可维护、可读的高质量代码,...