Skip to content

Commit 1e988c1

Browse files
committed
fixed merge conflict
2 parents 2c45f73 + 0a9879a commit 1e988c1

File tree

178 files changed

+3329
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+3329
-549
lines changed

.travis.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
language: java
2-
32
jdk:
4-
- oraclejdk8
3+
- oraclejdk8
54

6-
before_install:
7-
- "export DISPLAY=:99.0"
8-
- "sh -e /etc/init.d/xvfb start"
5+
env:
6+
global:
7+
- GH_REF: github.com/iluwatar/java-design-patterns.git
8+
- secure: LxTDuNS/rBWIvKkaEqr79ImZAe48mCdoYCF41coxNXgNoippo4GIBArknqtv+XvdkiuRZ1yGyj6pn8GU33c/yn+krddTUkVCwTbVatbalW5jhQjDbHYym/JcxaK9ZS/3JTeGcWrBgiPqHEEDhCf26vPZsXoMSeVCEORVKTp1BSg=
99

10+
before_install:
11+
- export DISPLAY=:99.0
12+
- sh -e /etc/init.d/xvfb start
13+
1014
after_success:
11-
- mvn clean test jacoco:report coveralls:report
15+
- mvn clean test jacoco:report coveralls:report
16+
- bash update-ghpages.sh
1217

13-
# Migration to container-based infrastructure
1418
sudo: false

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,23 @@ Reusing design patterns helps to prevent subtle issues that can cause major
2121
problems, and it also improves code readability for coders and architects who
2222
are familiar with the patterns.
2323

24+
# Getting started
25+
26+
Before you dive into the material, you should be familiar with various
27+
[Programming/Software Design Principles](http://webpro.github.io/programming-principles/).
28+
29+
Once you are familiar with these concepts you can start drilling down into patterns by any of the following approaches
30+
31+
- Using difficulty tags, `Difficulty-Beginner`, `Difficulty-Intermediate` & `Difficulty-Expert`.
32+
- Using pattern categories, `Creational`, `Behavioral` and others.
33+
- Search for a specific pattern. Can't find one? Please report a new pattern [here](https://github.com/iluwatar/java-design-patterns/issues).
34+
2435
# How to contribute
2536

2637
If you are willing to contribute to the project you will find the relevant information in our [developer wiki](https://github.com/iluwatar/java-design-patterns/wiki).
2738

2839
# Credits
2940

30-
* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612)
3141
* [Effective Java (2nd Edition)](http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683)
3242
* [Java Generics and Collections](http://www.amazon.com/Java-Generics-Collections-Maurice-Naftalin/dp/0596527756/)
3343
* [Let's Modify the Objects-First Approach into Design-Patterns-First](http://edu.pecinovsky.cz/papers/2006_ITiCSE_Design_Patterns_First.pdf)
@@ -37,7 +47,6 @@ If you are willing to contribute to the project you will find the relevant infor
3747
* [Patterns of Enterprise Application Architecture](http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420)
3848
* [Spring Data](http://www.amazon.com/Spring-Data-Mark-Pollack/dp/1449323952/ref=sr_1_1)
3949
* [J2EE Design Patterns](http://www.amazon.com/J2EE-Design-Patterns-William-Crawford/dp/0596004273/ref=sr_1_2)
40-
* [Pattern Oriented Software Architecture Vol I-V](http://www.amazon.com/Pattern-Oriented-Software-Architecture-Volume-Patterns/dp/0471958697)
4150

4251
# License
4352

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)

abstract-factory/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.iluwatar</groupId>
77
<artifactId>java-design-patterns</artifactId>
8-
<version>1.6.0</version>
8+
<version>1.7.0</version>
99
</parent>
1010
<artifactId>abstract-factory</artifactId>
1111
<dependencies>

abstract-factory/src/main/java/com/iluwatar/abstractfactory/App.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33

44
/**
55
*
6+
* The Abstract Factory pattern provides a way to encapsulate a group of individual
7+
* factories that have a common theme without specifying their concrete classes. In
8+
* normal usage, the client software creates a concrete implementation of the abstract
9+
* factory and then uses the generic interface of the factory to create the concrete
10+
* objects that are part of the theme. The client does not know (or care) which
11+
* concrete objects it gets from each of these internal factories, since it uses only
12+
* the generic interfaces of their products. This pattern separates the details of
13+
* implementation of a set of objects from their general usage and relies on object
14+
* composition, as object creation is implemented in methods exposed in the factory
15+
* interface.
16+
* <p>
617
* The essence of the Abstract Factory pattern is a factory interface
718
* ({@link KingdomFactory}) and its implementations ({@link ElfKingdomFactory},
8-
* {@link OrcKingdomFactory}).
9-
* <p>
10-
* The example uses both concrete implementations to create a king, a castle and
11-
* an army.
19+
* {@link OrcKingdomFactory}). The example uses both concrete implementations to
20+
* create a king, a castle and an army.
1221
*
1322
*/
1423
public class App {

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)

adapter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.iluwatar</groupId>
77
<artifactId>java-design-patterns</artifactId>
8-
<version>1.6.0</version>
8+
<version>1.7.0</version>
99
</parent>
1010
<artifactId>adapter</artifactId>
1111
<dependencies>

adapter/src/main/java/com/iluwatar/adapter/App.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
package com.iluwatar.adapter;
22

33
/**
4-
*
4+
*
5+
* An adapter helps two incompatible interfaces to work together. This is the real
6+
* world definition for an adapter. Interfaces may be incompatible but the inner
7+
* functionality should suit the need. The Adapter design pattern allows otherwise
8+
* incompatible classes to work together by converting the interface of one class
9+
* into an interface expected by the clients.
10+
* <p>
511
* There are two variations of the Adapter pattern: The class adapter implements
612
* the adaptee's interface whereas the object adapter uses composition to
713
* contain the adaptee in the adapter object. This example uses the object

async-method-invocation/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.iluwatar</groupId>
77
<artifactId>java-design-patterns</artifactId>
8-
<version>1.6.0</version>
8+
<version>1.7.0</version>
99
</parent>
1010
<artifactId>async-method-invocation</artifactId>
1111
<dependencies>

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)

0 commit comments

Comments
 (0)