Skip to content

Commit

Permalink
Work on iluwatar#213
Browse files Browse the repository at this point in the history
- properly categorize all patterns
- remove pattern list from readme
- minor fixes to readme
- removed "introduction" because its not a pattern and an error i
committed some time ago
  • Loading branch information
Markus authored and Markus committed Aug 20, 2015
1 parent 9691a37 commit 5ce932c
Show file tree
Hide file tree
Showing 58 changed files with 129 additions and 265 deletions.
148 changes: 17 additions & 131 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Design pattern samples in Java.
<!-- the line below needs to be an empty line C: (its because kramdown isnt
that smart and dearly wants an empty line before a heading to be able to
display it as such, e.g. website) -->

# Design pattern samples in Java

[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand All @@ -7,24 +11,19 @@
src="https://scan.coverity.com/projects/5634/badge.svg"/>
</a>

<a name="top"/>

#### Browse and view all of the patterns on our Website: [iluwatar.github.io/java-design-patterns/](https://iluwatar.github.io/java-design-patterns/)

<a name="top"/>

# <a name="toc">Table of Contents</a>
- <a href="#introduction">Introduction</a>
- <a href="#list-of-design-patterns">List of Design Patterns</a>
- <a href="#creational-patterns">Creational Patterns</a>
- <a href="#structural-patterns">Structural Patterns</a>
- <a href="#behavioral-patterns">Behavioral Patterns</a>
- <a href="#concurrency-patterns">Concurrency Patterns</a>
- <a href="#presentation-tier-patterns">Presentation Tier Patterns</a>
- <a href="#business-tier-patterns">Business Tier Patterns</a>
- <a href="#architectural-patterns">Architectural Patterns</a>
- <a href="#integration-patterns">Integration Patterns</a>
- <a href="#idioms">Idioms</a>
- <a href="#faq">Frequently Asked Questions</a>
- <a href="#how-to-contribute">How to contribute</a>
- <a href="#versioning">Versioning</a>
- <a href="#credits">Credits</a>
- <a href="#license">License</a>


## <a name="introduction">Introduction</a>

Expand All @@ -38,119 +37,6 @@ Reusing design patterns helps to prevent subtle issues that can cause major
problems, and it also improves code readability for coders and architects who
are familiar with the patterns.

## <a name="list-of-design-patterns">List of Design Patterns</a> [&#8593;](#top)

### <a name="creational-patterns">Creational Patterns</a> [&#8593;](#top)

Creational design patterns abstract the instantiation process. They help make a
system independent of how its objects are created, composed, and represented.

* [Abstract Factory](#abstract-factory)
* [Builder](#builder)
* [Factory Method](#factory-method)
* [Prototype](#prototype)
* [Property](#property)
* [Singleton](#singleton)
* [Step Builder](#step-builder)
* [Multiton](#multiton)
* [Object Pool](#object-pool)

### <a name="structural-patterns">Structural Patterns</a> [&#8593;](#top)

Structural patterns are concerned with how classes and objects are composed to
form larger structures.

* [Adapter](#adapter)
* [Bridge](#bridge)
* [Composite](#composite)
* [Decorator](#decorator)
* [Facade](#facade)
* [Flyweight](#flyweight)
* [Proxy](#proxy)
* [Service Locator](#service-locator)
* [Servant](#servant)
* [Event Aggregator](#event-aggregator)

### <a name="behavioral-patterns">Behavioral Patterns</a> [&#8593;](#top)

Behavioral patterns are concerned with algorithms and the assignment of
responsibilities between objects.

* [Chain of responsibility](#chain-of-responsibility)
* [Command](#command)
* [Interpreter](#interpreter)
* [Iterator](#iterator)
* [Mediator](#mediator)
* [Memento](#memento)
* [Observer](#observer)
* [State](#state)
* [Strategy](#strategy)
* [Template method](#template-method)
* [Visitor](#visitor)
* [Null Object](#null-object)
* [Intercepting Filter](#intercepting-filter)
* [Specification](#specification)
* [Dependency Injection](#dependency-injection)

### <a name="concurrency-patterns">Concurrency Patterns</a> [&#8593;](#top)

Concurrency patterns are those types of design patterns that deal with the
multi-threaded programming paradigm.

* [Double Checked Locking](#double-checked-locking)
* [Thread Pool](#thread-pool)
* [Async Method Invocation](#async-method-invocation)
* [Half-Sync/Half-Async](#half-sync-half-async)

### <a name="presentation-tier-patterns">Presentation Tier Patterns</a> [&#8593;](#top)

Presentation Tier patterns are the top-most level of the application, this is
concerned with translating tasks and results to something the user can
understand.

* [Model-View-Controller](#model-view-controller)
* [Model-View-Presenter](#model-view-presenter)
* [Flux](#flux)
* [Front Controller](#front-controller)

### <a name="business-tier-patterns">Business Tier Patterns</a> [&#8593;](#top)

* [Business Delegate](#business-delegate)

### <a name="architectural-patterns">Architectural Patterns</a> [&#8593;](#top)

An architectural pattern is a general, reusable solution to a commonly occurring
problem in software architecture within a given context.

* [Data Access Object](#dao)
* [Service Layer](#service-layer)
* [Naked Objects](#naked-objects)
* [Repository](#repository)

### <a name="integration-patterns">Integration Patterns</a> [&#8593;](#top)

Integration patterns are concerned with how software applications communicate
and exchange data.

* [Tolerant Reader](#tolerant-reader)

### <a name="idioms">Idioms</a> [&#8593;](#top)

A programming idiom is a means of expressing a recurring construct in one or
more programming languages. Generally speaking, a programming idiom is an
expression of a simple task, algorithm, or data structure that is not a built-in
feature in the programming language being used, or, conversely, the use of an
unusual or notable feature that is built into a programming language. What
distinguishes idioms from patterns is generally the size, the idioms tend to be
something small while the patterns are larger.

* [Execute Around](#execute-around)
* [Poison Pill](#poison-pill)
* [Callback](#callback)
* [Lazy Loading](#lazy-loading)
* [Double Dispatch](#double-dispatch)
* [Resource Acquisition Is Initialization](#resource-acquisition-is-initialization)
* [Private Class Data](#private-class-data)

# <a name="faq">Frequently asked questions</a> [&#8593;](#top)

Expand Down Expand Up @@ -225,16 +111,16 @@ Flyweight.
* src (the source code of the pattern)
* index.md (the description of the pattern)
* pom.xml (the maven pom.xml)
3. Implement the code changes in your fork. Remember to add sufficient comments
4. Implement the code changes in your fork. Remember to add sufficient comments
documenting the implementation. Reference the issue id e.g. #52 in your
commit messages.
4. Format the code according to [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)
5. Format the code according to [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)
* [Eclipse configuration](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml)
* [IntelliJ configuration](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml)
5. Create a simple class diagram from your example code and put it inside of the etc folder.
6. Add description of the pattern in index.md and link to the class diagram.
6. Create a simple class diagram from your example code and put it inside of the etc folder.
7. Add description of the pattern in index.md and link to the class diagram.
(Attention, all internal links must be relative to the pattern subdirectory, else the links dont link properly on the website)
7. Create a pull request.
8. Create a pull request.

**Structure of the index.md file**

Expand Down
6 changes: 2 additions & 4 deletions abstract-factory/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ layout: pattern
title: Abstract Factory
folder: abstract-factory
permalink: /patterns/abstract-factory/
categories:
- pattern_cat
- creational
tags: pattern_tag
categories: Creational
tags: Java
---

**Intent:** Provide an interface for creating families of related or dependent
Expand Down
4 changes: 2 additions & 2 deletions adapter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Adapter
folder: adapter
permalink: /patterns/adapter/
categories: structural
tags: pattern_tag
categories: Structural
tags: Java
---

**Intent:** Convert the interface of a class into another interface the clients
Expand Down
4 changes: 2 additions & 2 deletions async-method-invocation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Async Method Invocation
folder: async-method-invocation
permalink: /patterns/async-method-invocation/
categories: concurrency
tags: pattern_tag
categories: Concurrency
tags: Java
---

**Intent:** Asynchronous method invocation is pattern where the calling thread
Expand Down
4 changes: 2 additions & 2 deletions bridge/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Bridge
folder: bridge
permalink: /patterns/bridge/
categories: structural
tags: pattern_tag
categories: Structural
tags: Java
---

**Intent:** Decouple an abstraction from its implementation so that the two can
Expand Down
4 changes: 2 additions & 2 deletions builder/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Builder
folder: builder
permalink: /patterns/builder/
categories: creational
tags: pattern_tag
categories: Creational
tags: Java
---

**Intent:** Separate the construction of a complex object from its
Expand Down
4 changes: 2 additions & 2 deletions business-delegate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Business Delegate
folder: business-delegate
permalink: /patterns/business-delegate/
categories: business_tier
tags: pattern_tag
categories: Business Tier
tags: Java
---

**Intent:** The Business Delegate pattern adds an abstraction layer between
Expand Down
4 changes: 2 additions & 2 deletions callback/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Callback
folder: callback
permalink: /patterns/callback/
categories: pattern_cat
tags: pattern_tag
categories: Other
tags: Java
---

**Intent:** Callback is a piece of executable code that is passed as an
Expand Down
4 changes: 2 additions & 2 deletions chain-of-responsibility/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Chain of responsibility
folder: chain-of-responsibility
permalink: /patterns/chain-of-responsibility/
categories: behavioral
tags: pattern_tag
categories: Behavioral
tags: Java
---

**Intent:** Avoid coupling the sender of a request to its receiver by giving
Expand Down
4 changes: 2 additions & 2 deletions command/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Command
folder: command
permalink: /patterns/command/
categories: behavioral
tags: pattern_tag
categories: Behavioral
tags: Java
---

**Intent:** Encapsulate a request as an object, thereby letting you
Expand Down
4 changes: 2 additions & 2 deletions composite/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Composite
folder: composite
permalink: /patterns/composite/
categories: pattern_cat
tags: pattern_tag
categories: Structural
tags: Java
---

**Intent:** Compose objects into tree structures to represent part-whole
Expand Down
4 changes: 2 additions & 2 deletions dao/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Data Access Object
folder: dao
permalink: /patterns/dao/
categories: architectural
tags: pattern_tag
categories: Architectural
tags: Java
---

**Intent:** Object provides an abstract interface to some type of database or
Expand Down
4 changes: 2 additions & 2 deletions decorator/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Decorator
folder: decorator
permalink: /patterns/decorator/
categories: structural
tags: pattern_tag
categories: Structural
tags: Java
---

**Intent:** Attach additional responsibilities to an object dynamically.
Expand Down
4 changes: 2 additions & 2 deletions dependency-injection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Dependency Injection
folder: dependency-injection
permalink: /patterns/dependency-injection/
categories: behavioral
tags: pattern_tag
categories: Behavioral
tags: Java
---

**Intent:** Dependency Injection is a software design pattern in which one or
Expand Down
4 changes: 2 additions & 2 deletions double-checked-locking/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Double Checked Locking
folder: double-checked-locking
permalink: /patterns/double-checked-locking/
categories: concurrency
tags: pattern_tag
categories: Concurrency
tags: Java
---

**Intent:** Reduce the overhead of acquiring a lock by first testing the
Expand Down
4 changes: 2 additions & 2 deletions double-dispatch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Double Dispatch
folder: double-dispatch
permalink: /patterns/double-dispatch/
categories: pattern_cat
tags: pattern_tag
categories: Other
tags: Java
---

**Intent:** Double Dispatch pattern is a way to create maintainable dynamic
Expand Down
4 changes: 2 additions & 2 deletions event-aggregator/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Event Aggregator
folder: event-aggregator
permalink: /patterns/event-aggregator/
categories: structural
tags: pattern_tag
categories: Structural
tags: Java
---

**Intent:** A system with lots of objects can lead to complexities when a
Expand Down
4 changes: 2 additions & 2 deletions execute-around/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Execute Around
folder: execute-around
permalink: /patterns/execute-around/
categories: pattern_cat
tags: pattern_tag
categories: Other
tags: Java
---

**Intent:** Execute Around idiom frees the user from certain actions that
Expand Down
4 changes: 2 additions & 2 deletions facade/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Facade
folder: facade
permalink: /patterns/facade/
categories: structural
tags: pattern_tag
categories: Structural
tags: Java
---

**Intent:** Provide a unified interface to a set of interfaces in a subsystem.
Expand Down
4 changes: 2 additions & 2 deletions factory-method/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: pattern
title: Factory Method
folder: factory-method
permalink: /patterns/factory-method/
categories: creational
tags: pattern_tag
categories: Creational
tags: Java
---

**Intent:** Define an interface for creating an object, but let subclasses
Expand Down
Loading

0 comments on commit 5ce932c

Please sign in to comment.