Aggregation和Composition

下面的话摘自Java Persistence with Hibernate!

面向对象术语中,聚合(aggregation)—— 是一种part-of关系。聚合是一种强类型的关联(association); it has some additional semantics with regard to the lifecycle of objects。

组合(composition),是一种比聚合还要强类型的关联,部分要完全依赖于整体的生命周期。

猜你喜欢

转载自zsjg13.iteye.com/blog/2211067