GeezerVison is showing github.com — Work on #226, #213, added references of Gang Of Four to all GoF patte… · wangwch/java-design-patterns@b3e4e8a
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: abstract-factory/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Abstract Factory | 4 | 4 | folder: abstract-factory | 5 | 5 | permalink: /patterns/abstract-factory/ | 6 | 6 | categories: Creational | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Provide an interface for creating families of related or dependent | @@ -22,3 +24,7 @@ objects without specifying their concrete classes. | 22 | 24 | **Real world examples:** | 23 | 25 |
| 24 | 26 | * [javax.xml.parsers.DocumentBuilderFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/parsers/DocumentBuilderFactory.html) | | 27 | + | | 28 | +**Credits** | | 29 | + | | 30 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: adapter/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Adapter | 4 | 4 | folder: adapter | 5 | 5 | permalink: /patterns/adapter/ | 6 | 6 | categories: Structural | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Convert the interface of a class into another interface the clients | @@ -22,3 +24,7 @@ incompatible interfaces. | 22 | 24 | **Real world examples:** | 23 | 25 |
| 24 | 26 | * [java.util.Arrays#asList()](http://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#asList%28T...%29) | | 27 | + | | 28 | +**Credits** | | 29 | + | | 30 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: bridge/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Bridge | 4 | 4 | folder: bridge | 5 | 5 | permalink: /patterns/bridge/ | 6 | 6 | categories: Structural | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Decouple an abstraction from its implementation so that the two can | @@ -20,3 +22,7 @@ vary independently. | 20 | 22 | * changes in the implementation of an abstraction should have no impact on clients; that is, their code should not have to be recompiled. | 21 | 23 | * 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 | 22 | 24 | * 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. | | 25 | + | | 26 | +**Credits** | | 27 | + | | 28 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: builder/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Builder | 4 | 4 | folder: builder | 5 | 5 | permalink: /patterns/builder/ | 6 | 6 | categories: Creational | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Separate the construction of a complex object from its | @@ -22,3 +24,7 @@ representations. | 22 | 24 |
| 23 | 25 | * [java.lang.StringBuilder](http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html) | 24 | 26 | * [Apache Camel builders](https://github.com/apache/camel/tree/0e195428ee04531be27a0b659005e3aa8d159d23/camel-core/src/main/java/org/apache/camel/builder) | | 27 | + | | 28 | +**Credits** | | 29 | + | | 30 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: chain/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Chain of responsibility | 4 | 4 | folder: chain | 5 | 5 | permalink: /patterns/chain/ | 6 | 6 | categories: Behavioral | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Avoid coupling the sender of a request to its receiver by giving | @@ -23,3 +25,7 @@ objects and pass the request along the chain until an object handles it. | 23 | 25 |
| 24 | 26 | * [java.util.logging.Logger#log()](http://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html#log%28java.util.logging.Level,%20java.lang.String%29) | 25 | 27 | * [Apache Commons Chain](https://commons.apache.org/proper/commons-chain/index.html) | | 28 | + | | 29 | +**Credits** | | 30 | + | | 31 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: command/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Command | 4 | 4 | folder: command | 5 | 5 | permalink: /patterns/command/ | 6 | 6 | categories: Behavioral | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Encapsulate a request as an object, thereby letting you | @@ -30,3 +32,7 @@ support undoable operations. | 30 | 32 | **Real world examples:** | 31 | 33 |
| 32 | 34 | * [java.lang.Runnable](http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html) | | 35 | + | | 36 | +**Credits** | | 37 | + | | 38 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: composite/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Composite | 4 | 4 | folder: composite | 5 | 5 | permalink: /patterns/composite/ | 6 | 6 | categories: Structural | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Compose objects into tree structures to represent part-whole | @@ -22,3 +24,7 @@ of objects uniformly. | 22 | 24 |
| 23 | 25 | * [java.awt.Container](http://docs.oracle.com/javase/8/docs/api/java/awt/Container.html) and [java.awt.Component](http://docs.oracle.com/javase/8/docs/api/java/awt/Component.html) | 24 | 26 | * [Apache Wicket](https://github.com/apache/wicket) component tree, see [Component](https://github.com/apache/wicket/blob/91e154702ab1ff3481ef6cbb04c6044814b7e130/wicket-core/src/main/java/org/apache/wicket/Component.java) and [MarkupContainer](https://github.com/apache/wicket/blob/b60ec64d0b50a611a9549809c9ab216f0ffa3ae3/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java) | | 27 | + | | 28 | +**Credits** | | 29 | + | | 30 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: decorator/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Decorator | 4 | 4 | folder: decorator | 5 | 5 | permalink: /patterns/decorator/ | 6 | 6 | categories: Structural | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Attach additional responsibilities to an object dynamically. | @@ -18,3 +20,7 @@ functionality. | 18 | 20 | * to add responsibilities to individual objects dynamically and transparently, that is, without affecting other objects | 19 | 21 | * for responsibilities that can be withdrawn | 20 | 22 | * when extension by subclassing is impractical. Sometimes a large number of independent extensions are possible and would produce an explosion of subclasses to support every combination. Or a class definition may be hidden or otherwise unavailable for subclassing | | 23 | + | | 24 | +**Credits** | | 25 | + | | 26 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: facade/index.md +7-1Lines changed: 7 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,9 @@ title: Facade | 4 | 4 | folder: facade | 5 | 5 | permalink: /patterns/facade/ | 6 | 6 | categories: Structural | 7 | | -tags: Java | | 7 | +tags: | | 8 | + - Java | | 9 | + - Gang Of Four | 8 | 10 | --- | 9 | 11 |
| 10 | 12 | **Intent:** Provide a unified interface to a set of interfaces in a subsystem. | @@ -17,3 +19,7 @@ Facade defines a higher-level interface that makes the subsystem easier to use. | 17 | 19 | * you want to provide a simple interface to a complex subsystem. Subsystems often get more complex as they evolve. Most patterns, when applied, result in more and smaller classes. This makes the subsystem more reusable and easier to customize, but it also becomes harder to use for clients that don't need to customize it. A facade can provide a simple default view of the subsystem that is good enough for most clients. Only clients needing more customizability will need to look beyond the facade. | 18 | 20 | * there are many dependencies between clients and the implementation classes of an abstraction. Introduce a facade to decouple the subsystem from clients and other subsystems, thereby promoting subsystem independence and portability. | 19 | 21 | * you want to layer your subsystems. Use a facade to define an entry point to each subsystem level. If subsystems are dependent, the you can simplify the dependencies between them by making them communicate with each other solely through their facades | | 22 | + | | 23 | +**Credits** | | 24 | + | | 25 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
Collapse file Copy file name to clipboardExpand all lines: factory-method/index.md +5Lines changed: 5 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,7 @@ categories: Creational | 7 | 7 | tags: | 8 | 8 | - Java | 9 | 9 | - Difficulty-Beginner | | 10 | + - Gang Of Four | 10 | 11 | --- | 11 | 12 |
| 12 | 13 | **Intent:** Define an interface for creating an object, but let subclasses | @@ -20,3 +21,7 @@ instantiation to subclasses. | 20 | 21 | * a class can't anticipate the class of objects it must create | 21 | 22 | * a class wants its subclasses to specify the objects it creates | 22 | 23 | * classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate | | 24 | + | | 25 | +**Credits** | | 26 | + | | 27 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
|