Update README.md
This commit is contained in:
parent
c6f4cb2577
commit
38954a47de
10
README.md
10
README.md
@ -64,6 +64,16 @@
|
||||
##Bridge
|
||||
**Intent:** Decouple an abstraction from its implementationso that the two can vary independently.
|
||||
|
||||
|
||||

|
||||
|
||||
**Applicability:** Use the Bridge pattern when
|
||||
* you want to avoid a permanent binding between an abstraction and its implementation. This might be the case, for example, when the implementation must be selected or switched at run-time.
|
||||
* both the abstractions and their implementations should be extensible by subclassing. In this case, the Bridge pattern lets you combine the different abstractions and implementations and extend them independently
|
||||
* changes in the implementation of an abstraction should have no impact on clients; that is, their code should not have to be recompiled.
|
||||
* you have a proliferation of classes. Such a class hierarchy indicates the need for splitting an object into two parts. Rumbaugh uses the term "nested generalizations" to refer to such class hierarchies
|
||||
* you want to share an implementation among multiple objects (perhaps using reference counting), and this fact should be hidden from the client. A simple example is Coplien's String class, in which multiple objects can share the same string representation.
|
||||
|
||||
##Composite
|
||||
**Intent:** Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user