码迷,mamicode.com
首页 > 其他好文 > 详细

Some UML discussions

时间:2015-07-01 13:42:00      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:

Association vs. Dependency vs. Aggregation vs. Composition

https://nirajrules.wordpress.com/2011/07/15/association-vs-dependency-vs-aggregation-vs-composition/

An useful comment:

I always view association as something to be used in an early stage of analysis. Once a model has been created, the associations indicate potential dependencies. It then becomes an exercise in reducing dependencies to decrease coupling and increase orthogonality.The next stage would then be to determine whether an object needs a member reference to the object it depends on or if it is just transient for a particular method or methods. An exercise in managing dependency injection I guess :)If it is decided that the reference needs to be a member of the dependent object, then the dependency becomes an aggregation.Then if the dependent object needs to own the object that it depends on and control its lifetime then the aggregation becomes a composition.So I guess I see all the relationships as extension of each other. Composition extends Aggregation, Aggregation extends Dependency and Dependency extends Association.

 

UML Class Diagram: Association, Aggregation and Composition

http://aviadezra.blogspot.com/2009/05/uml-association-aggregation-composition.html

 

Dependency in UML

http://www.uml-diagrams.org/dependency.html

Some UML discussions

标签:

原文地址:http://www.cnblogs.com/smcnblogs/p/4612897.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!