Skip to content

Commit 38954a4

Browse files
committed
Update README.md
1 parent c6f4cb2 commit 38954a4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@
6464
##Bridge
6565
**Intent:** Decouple an abstraction from its implementationso that the two can vary independently.
6666

67+
68+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/bridge/etc/bridge.jpg "Bridge")
69+
70+
**Applicability:** Use the Bridge pattern when
71+
* 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.
72+
* 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
73+
* changes in the implementation of an abstraction should have no impact on clients; that is, their code should not have to be recompiled.
74+
* 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
75+
* 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.
76+
6777
##Composite
6878
**Intent:** Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
6979

0 commit comments

Comments
 (0)