您的位置:首页 > 其它

design pattern notes [1] - Bridge and composite

2012-12-13 09:49 281 查看
Bridge pathern is used to decouple abstraction and implementation so that both can involve independently. This makes it easy to modify, extend and reuse abstraction and implementation independently.

Abstraction owns one reference of implementer. Client does not know which implementer it is handling. The implementer is transparent to it.

Bridge pathern is used to decouple abstraction and implementation so that both can involve independently.

Abstraction owns one reference of implementer.

One composite is one container which is composed of some leaves which have identical interfaces with the container. Both the container and its leaves(children) are inherited from component (abstract class). The container has a list (or something like), used
to traverse its children. The child may owns reference to its parent (container)

One container is one kind of large leaf (component) which is composed of lightweight components.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: