相关疑难解决方法(0)

差异聚合,熟人和构图(由Gang Of Four使用)

我一直在阅读设计模式:可重复使用的面向对象软件的元素, 并得到了部分解释aggregationacquaintance.这是摘录(对不起,如果它太长了,但我认为解释这个问题很重要):

Consider the distinction between object aggregation and acquaintance and how
differently they manifest themselves at compile- and run-times. Aggregation
implies that one object owns or is responsible for another object. Generally we
speak of an object having or being part of another object. Aggregation implies
that an aggregate object and its owner have identical lifetimes.

Acquaintance implies that an object merely knows of another object. Sometimes
acquaintance is called "association" or the "using" …
Run Code Online (Sandbox Code Playgroud)

oop design-patterns

7
推荐指数
2
解决办法
2111
查看次数

标签 统计

design-patterns ×1

oop ×1