X Tutup
Skip to content

Commit b3e4e8a

Browse files
committed
Work on iluwatar#226, iluwatar#213, added references of Gang Of Four to all GoF patterns, added tag for Gang Of Four, added difficulty tags to some of them
1 parent dd0fcea commit b3e4e8a

File tree

23 files changed

+168
-22
lines changed

23 files changed

+168
-22
lines changed

abstract-factory/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Abstract Factory
44
folder: abstract-factory
55
permalink: /patterns/abstract-factory/
66
categories: Creational
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**Intent:** Provide an interface for creating families of related or dependent
@@ -22,3 +24,7 @@ objects without specifying their concrete classes.
2224
**Real world examples:**
2325

2426
* [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)

adapter/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Adapter
44
folder: adapter
55
permalink: /patterns/adapter/
66
categories: Structural
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**Intent:** Convert the interface of a class into another interface the clients
@@ -22,3 +24,7 @@ incompatible interfaces.
2224
**Real world examples:**
2325

2426
* [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)

bridge/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Bridge
44
folder: bridge
55
permalink: /patterns/bridge/
66
categories: Structural
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**Intent:** Decouple an abstraction from its implementation so that the two can
@@ -20,3 +22,7 @@ vary independently.
2022
* changes in the implementation of an abstraction should have no impact on clients; that is, their code should not have to be recompiled.
2123
* 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
2224
* 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)

builder/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Builder
44
folder: builder
55
permalink: /patterns/builder/
66
categories: Creational
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**Intent:** Separate the construction of a complex object from its
@@ -22,3 +24,7 @@ representations.
2224

2325
* [java.lang.StringBuilder](http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html)
2426
* [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)

chain/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Chain of responsibility
44
folder: chain
55
permalink: /patterns/chain/
66
categories: Behavioral
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**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.
2325

2426
* [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)
2527
* [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)

command/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Command
44
folder: command
55
permalink: /patterns/command/
66
categories: Behavioral
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**Intent:** Encapsulate a request as an object, thereby letting you
@@ -30,3 +32,7 @@ support undoable operations.
3032
**Real world examples:**
3133

3234
* [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)

composite/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Composite
44
folder: composite
55
permalink: /patterns/composite/
66
categories: Structural
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**Intent:** Compose objects into tree structures to represent part-whole
@@ -22,3 +24,7 @@ of objects uniformly.
2224

2325
* [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)
2426
* [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)

decorator/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Decorator
44
folder: decorator
55
permalink: /patterns/decorator/
66
categories: Structural
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**Intent:** Attach additional responsibilities to an object dynamically.
@@ -18,3 +20,7 @@ functionality.
1820
* to add responsibilities to individual objects dynamically and transparently, that is, without affecting other objects
1921
* for responsibilities that can be withdrawn
2022
* 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)

facade/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Facade
44
folder: facade
55
permalink: /patterns/facade/
66
categories: Structural
7-
tags: Java
7+
tags:
8+
- Java
9+
- Gang Of Four
810
---
911

1012
**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.
1719
* 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.
1820
* 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.
1921
* 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)

factory-method/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ categories: Creational
77
tags:
88
- Java
99
- Difficulty-Beginner
10+
- Gang Of Four
1011
---
1112

1213
**Intent:** Define an interface for creating an object, but let subclasses
@@ -20,3 +21,7 @@ instantiation to subclasses.
2021
* a class can't anticipate the class of objects it must create
2122
* a class wants its subclasses to specify the objects it creates
2223
* 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)

0 commit comments

Comments
 (0)
X Tutup