设计模式 Tips
2010-08-03 23:40 宗哥 阅读(196) 评论(0) 编辑 收藏 举报Often, the Strategy Pattern is confused with the Bridge Pattern. Even though, these two patterns are similar in structure, they are trying to solve two different design problems. Strategy is mainly concerned in encapsulating algorithms, whereas Bridge decouples the abstraction from the implementation, to provide different implementation for the same abstraction.
Bridge 强调Abstraction and its Implementation,Strategy强调Aalgorithm Family
Bridge and Adapter
The structure of the Adapter Pattern (object adapter) may look similar to the Bridge Pattern. However, the adapter is meant to change the interface of an existing object and is mainly intended to make unrelated classes work together.
Adapter突出existing,reuse。
声明: 本文作者:宗哥,宗子城
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明。 ...