Work on #213
- 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
This commit is contained in:
parent
9691a371e6
commit
5ce932ceb7
148
README.md
148
README.md
@ -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
|
||||||
|
|
||||||
[](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
@ -7,24 +11,19 @@
|
|||||||
src="https://scan.coverity.com/projects/5634/badge.svg"/>
|
src="https://scan.coverity.com/projects/5634/badge.svg"/>
|
||||||
</a>
|
</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="#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="#faq">Frequently Asked Questions</a>
|
||||||
- <a href="#how-to-contribute">How to contribute</a>
|
- <a href="#how-to-contribute">How to contribute</a>
|
||||||
- <a href="#versioning">Versioning</a>
|
- <a href="#versioning">Versioning</a>
|
||||||
- <a href="#credits">Credits</a>
|
- <a href="#credits">Credits</a>
|
||||||
- <a href="#license">License</a>
|
- <a href="#license">License</a>
|
||||||
|
|
||||||
|
|
||||||
## <a name="introduction">Introduction</a>
|
## <a name="introduction">Introduction</a>
|
||||||
|
|
||||||
@ -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
|
problems, and it also improves code readability for coders and architects who
|
||||||
are familiar with the patterns.
|
are familiar with the patterns.
|
||||||
|
|
||||||
## <a name="list-of-design-patterns">List of Design Patterns</a> [↑](#top)
|
|
||||||
|
|
||||||
### <a name="creational-patterns">Creational Patterns</a> [↑](#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> [↑](#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> [↑](#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> [↑](#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> [↑](#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> [↑](#top)
|
|
||||||
|
|
||||||
* [Business Delegate](#business-delegate)
|
|
||||||
|
|
||||||
### <a name="architectural-patterns">Architectural Patterns</a> [↑](#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> [↑](#top)
|
|
||||||
|
|
||||||
Integration patterns are concerned with how software applications communicate
|
|
||||||
and exchange data.
|
|
||||||
|
|
||||||
* [Tolerant Reader](#tolerant-reader)
|
|
||||||
|
|
||||||
### <a name="idioms">Idioms</a> [↑](#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> [↑](#top)
|
# <a name="faq">Frequently asked questions</a> [↑](#top)
|
||||||
|
|
||||||
@ -225,16 +111,16 @@ Flyweight.
|
|||||||
* src (the source code of the pattern)
|
* src (the source code of the pattern)
|
||||||
* index.md (the description of the pattern)
|
* index.md (the description of the pattern)
|
||||||
* pom.xml (the maven pom.xml)
|
* 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
|
documenting the implementation. Reference the issue id e.g. #52 in your
|
||||||
commit messages.
|
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)
|
* [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)
|
* [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. 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.
|
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)
|
(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**
|
**Structure of the index.md file**
|
||||||
|
|
||||||
|
@ -3,10 +3,8 @@ layout: pattern
|
|||||||
title: Abstract Factory
|
title: Abstract Factory
|
||||||
folder: abstract-factory
|
folder: abstract-factory
|
||||||
permalink: /patterns/abstract-factory/
|
permalink: /patterns/abstract-factory/
|
||||||
categories:
|
categories: Creational
|
||||||
- pattern_cat
|
tags: Java
|
||||||
- creational
|
|
||||||
tags: pattern_tag
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Provide an interface for creating families of related or dependent
|
**Intent:** Provide an interface for creating families of related or dependent
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Adapter
|
title: Adapter
|
||||||
folder: adapter
|
folder: adapter
|
||||||
permalink: /patterns/adapter/
|
permalink: /patterns/adapter/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Convert the interface of a class into another interface the clients
|
**Intent:** Convert the interface of a class into another interface the clients
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Async Method Invocation
|
title: Async Method Invocation
|
||||||
folder: async-method-invocation
|
folder: async-method-invocation
|
||||||
permalink: /patterns/async-method-invocation/
|
permalink: /patterns/async-method-invocation/
|
||||||
categories: concurrency
|
categories: Concurrency
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Asynchronous method invocation is pattern where the calling thread
|
**Intent:** Asynchronous method invocation is pattern where the calling thread
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Bridge
|
title: Bridge
|
||||||
folder: bridge
|
folder: bridge
|
||||||
permalink: /patterns/bridge/
|
permalink: /patterns/bridge/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Decouple an abstraction from its implementation so that the two can
|
**Intent:** Decouple an abstraction from its implementation so that the two can
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Builder
|
title: Builder
|
||||||
folder: builder
|
folder: builder
|
||||||
permalink: /patterns/builder/
|
permalink: /patterns/builder/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Separate the construction of a complex object from its
|
**Intent:** Separate the construction of a complex object from its
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Business Delegate
|
title: Business Delegate
|
||||||
folder: business-delegate
|
folder: business-delegate
|
||||||
permalink: /patterns/business-delegate/
|
permalink: /patterns/business-delegate/
|
||||||
categories: business_tier
|
categories: Business Tier
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** The Business Delegate pattern adds an abstraction layer between
|
**Intent:** The Business Delegate pattern adds an abstraction layer between
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Callback
|
title: Callback
|
||||||
folder: callback
|
folder: callback
|
||||||
permalink: /patterns/callback/
|
permalink: /patterns/callback/
|
||||||
categories: pattern_cat
|
categories: Other
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Callback is a piece of executable code that is passed as an
|
**Intent:** Callback is a piece of executable code that is passed as an
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Chain of responsibility
|
title: Chain of responsibility
|
||||||
folder: chain-of-responsibility
|
folder: chain-of-responsibility
|
||||||
permalink: /patterns/chain-of-responsibility/
|
permalink: /patterns/chain-of-responsibility/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Avoid coupling the sender of a request to its receiver by giving
|
**Intent:** Avoid coupling the sender of a request to its receiver by giving
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Command
|
title: Command
|
||||||
folder: command
|
folder: command
|
||||||
permalink: /patterns/command/
|
permalink: /patterns/command/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Encapsulate a request as an object, thereby letting you
|
**Intent:** Encapsulate a request as an object, thereby letting you
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Composite
|
title: Composite
|
||||||
folder: composite
|
folder: composite
|
||||||
permalink: /patterns/composite/
|
permalink: /patterns/composite/
|
||||||
categories: pattern_cat
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Compose objects into tree structures to represent part-whole
|
**Intent:** Compose objects into tree structures to represent part-whole
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Data Access Object
|
title: Data Access Object
|
||||||
folder: dao
|
folder: dao
|
||||||
permalink: /patterns/dao/
|
permalink: /patterns/dao/
|
||||||
categories: architectural
|
categories: Architectural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Object provides an abstract interface to some type of database or
|
**Intent:** Object provides an abstract interface to some type of database or
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Decorator
|
title: Decorator
|
||||||
folder: decorator
|
folder: decorator
|
||||||
permalink: /patterns/decorator/
|
permalink: /patterns/decorator/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Attach additional responsibilities to an object dynamically.
|
**Intent:** Attach additional responsibilities to an object dynamically.
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Dependency Injection
|
title: Dependency Injection
|
||||||
folder: dependency-injection
|
folder: dependency-injection
|
||||||
permalink: /patterns/dependency-injection/
|
permalink: /patterns/dependency-injection/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Dependency Injection is a software design pattern in which one or
|
**Intent:** Dependency Injection is a software design pattern in which one or
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Double Checked Locking
|
title: Double Checked Locking
|
||||||
folder: double-checked-locking
|
folder: double-checked-locking
|
||||||
permalink: /patterns/double-checked-locking/
|
permalink: /patterns/double-checked-locking/
|
||||||
categories: concurrency
|
categories: Concurrency
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Reduce the overhead of acquiring a lock by first testing the
|
**Intent:** Reduce the overhead of acquiring a lock by first testing the
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Double Dispatch
|
title: Double Dispatch
|
||||||
folder: double-dispatch
|
folder: double-dispatch
|
||||||
permalink: /patterns/double-dispatch/
|
permalink: /patterns/double-dispatch/
|
||||||
categories: pattern_cat
|
categories: Other
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Double Dispatch pattern is a way to create maintainable dynamic
|
**Intent:** Double Dispatch pattern is a way to create maintainable dynamic
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Event Aggregator
|
title: Event Aggregator
|
||||||
folder: event-aggregator
|
folder: event-aggregator
|
||||||
permalink: /patterns/event-aggregator/
|
permalink: /patterns/event-aggregator/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** A system with lots of objects can lead to complexities when a
|
**Intent:** A system with lots of objects can lead to complexities when a
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Execute Around
|
title: Execute Around
|
||||||
folder: execute-around
|
folder: execute-around
|
||||||
permalink: /patterns/execute-around/
|
permalink: /patterns/execute-around/
|
||||||
categories: pattern_cat
|
categories: Other
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Execute Around idiom frees the user from certain actions that
|
**Intent:** Execute Around idiom frees the user from certain actions that
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Facade
|
title: Facade
|
||||||
folder: facade
|
folder: facade
|
||||||
permalink: /patterns/facade/
|
permalink: /patterns/facade/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Provide a unified interface to a set of interfaces in a subsystem.
|
**Intent:** Provide a unified interface to a set of interfaces in a subsystem.
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Factory Method
|
title: Factory Method
|
||||||
folder: factory-method
|
folder: factory-method
|
||||||
permalink: /patterns/factory-method/
|
permalink: /patterns/factory-method/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Define an interface for creating an object, but let subclasses
|
**Intent:** Define an interface for creating an object, but let subclasses
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Flux
|
title: Flux
|
||||||
folder: flux
|
folder: flux
|
||||||
permalink: /patterns/flux/
|
permalink: /patterns/flux/
|
||||||
categories: presentation_tier
|
categories: Presentation Tier
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Flux eschews MVC in favor of a unidirectional data flow. When a
|
**Intent:** Flux eschews MVC in favor of a unidirectional data flow. When a
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Flyweight
|
title: Flyweight
|
||||||
folder: flyweight
|
folder: flyweight
|
||||||
permalink: /patterns/flyweight/
|
permalink: /patterns/flyweight/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Use sharing to support large numbers of fine-grained objects
|
**Intent:** Use sharing to support large numbers of fine-grained objects
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Front Controller
|
title: Front Controller
|
||||||
folder: front-controller
|
folder: front-controller
|
||||||
permalink: /patterns/front-controller/
|
permalink: /patterns/front-controller/
|
||||||
categories: presentation_tier
|
categories: Presentation Tier
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Introduce a common handler for all requests for a web site. This
|
**Intent:** Introduce a common handler for all requests for a web site. This
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Half-Sync/Half-Async
|
title: Half-Sync/Half-Async
|
||||||
folder: half-sync-half-async
|
folder: half-sync-half-async
|
||||||
permalink: /patterns/half-sync-half-async/
|
permalink: /patterns/half-sync-half-async/
|
||||||
categories: concurrency
|
categories: Concurrency
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** The Half-Sync/Half-Async pattern decouples synchronous I/O from
|
**Intent:** The Half-Sync/Half-Async pattern decouples synchronous I/O from
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Intercepting Filter
|
title: Intercepting Filter
|
||||||
folder: intercepting-filter
|
folder: intercepting-filter
|
||||||
permalink: /patterns/intercepting-filter/
|
permalink: /patterns/intercepting-filter/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Provide pluggable filters to conduct necessary pre-processing and
|
**Intent:** Provide pluggable filters to conduct necessary pre-processing and
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Interpreter
|
title: Interpreter
|
||||||
folder: interpreter
|
folder: interpreter
|
||||||
permalink: /patterns/interpreter/
|
permalink: /patterns/interpreter/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Given a language, define a representation for its grammar along
|
**Intent:** Given a language, define a representation for its grammar along
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
layout: pattern
|
|
||||||
title: Introduction
|
|
||||||
folder: introduction
|
|
||||||
permalink: /patterns/introduction/
|
|
||||||
permalink: /patterns/introduction/
|
|
||||||
categories: pattern_cat
|
|
||||||
tags: pattern_tag
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
Design patterns are formalized best practices that the programmer can use to
|
|
||||||
solve common problems when designing an application or system.
|
|
||||||
|
|
||||||
Design patterns can speed up the development process by providing tested, proven
|
|
||||||
development paradigms.
|
|
||||||
|
|
||||||
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.
|
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Iterator
|
title: Iterator
|
||||||
folder: iterator
|
folder: iterator
|
||||||
permalink: /patterns/iterator/
|
permalink: /patterns/iterator/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Provide a way to access the elements of an aggregate object
|
**Intent:** Provide a way to access the elements of an aggregate object
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Layers
|
title: Layers
|
||||||
folder: layers
|
folder: layers
|
||||||
permalink: /patterns/layers/
|
permalink: /patterns/layers/
|
||||||
categories: architectural
|
categories: Architectural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Layers is an architectural style where software responsibilities are
|
**Intent:** Layers is an architectural style where software responsibilities are
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Lazy Loading
|
title: Lazy Loading
|
||||||
folder: lazy-loading
|
folder: lazy-loading
|
||||||
permalink: /patterns/lazy-loading/
|
permalink: /patterns/lazy-loading/
|
||||||
categories: pattern_cat
|
categories: Other
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Lazy loading is a design pattern commonly used to defer
|
**Intent:** Lazy loading is a design pattern commonly used to defer
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Mediator
|
title: Mediator
|
||||||
folder: mediator
|
folder: mediator
|
||||||
permalink: /patterns/mediator/
|
permalink: /patterns/mediator/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Define an object that encapsulates how a set of objects interact.
|
**Intent:** Define an object that encapsulates how a set of objects interact.
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Memento
|
title: Memento
|
||||||
folder: memento
|
folder: memento
|
||||||
permalink: /patterns/memento/
|
permalink: /patterns/memento/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Without violating encapsulation, capture and externalize an
|
**Intent:** Without violating encapsulation, capture and externalize an
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Model-View-Controller
|
title: Model-View-Controller
|
||||||
folder: model-view-controller
|
folder: model-view-controller
|
||||||
permalink: /patterns/model-view-controller/
|
permalink: /patterns/model-view-controller/
|
||||||
categories: presentation_tier
|
categories: Presentation Tier
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Separate the user interface into three interconnected components:
|
**Intent:** Separate the user interface into three interconnected components:
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Model-View-Presenter
|
title: Model-View-Presenter
|
||||||
folder: model-view-presenter
|
folder: model-view-presenter
|
||||||
permalink: /patterns/model-view-presenter/
|
permalink: /patterns/model-view-presenter/
|
||||||
categories: presentation_tier
|
categories: Presentation Tier
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Apply a "Separation of Concerns" principle in a way that allows
|
**Intent:** Apply a "Separation of Concerns" principle in a way that allows
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Multiton
|
title: Multiton
|
||||||
folder: multiton
|
folder: multiton
|
||||||
permalink: /patterns/multiton/
|
permalink: /patterns/multiton/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Ensure a class only has limited number of instances, and provide a
|
**Intent:** Ensure a class only has limited number of instances, and provide a
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Naked Objects
|
title: Naked Objects
|
||||||
folder: naked-objects
|
folder: naked-objects
|
||||||
permalink: /patterns/naked-objects/
|
permalink: /patterns/naked-objects/
|
||||||
categories: architectural
|
categories: Architectural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** The Naked Objects architectural pattern is well suited for rapid
|
**Intent:** The Naked Objects architectural pattern is well suited for rapid
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Null Object
|
title: Null Object
|
||||||
folder: null-object
|
folder: null-object
|
||||||
permalink: /patterns/null-object/
|
permalink: /patterns/null-object/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** In most object-oriented languages, such as Java or C#, references
|
**Intent:** In most object-oriented languages, such as Java or C#, references
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Object Pool
|
title: Object Pool
|
||||||
folder: object-pool
|
folder: object-pool
|
||||||
permalink: /patterns/object-pool/
|
permalink: /patterns/object-pool/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** When objects are expensive to create and they are needed only for
|
**Intent:** When objects are expensive to create and they are needed only for
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Observer
|
title: Observer
|
||||||
folder: observer
|
folder: observer
|
||||||
permalink: /patterns/observer/
|
permalink: /patterns/observer/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Define a one-to-many dependency between objects so that when one
|
**Intent:** Define a one-to-many dependency between objects so that when one
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Poison Pill
|
title: Poison Pill
|
||||||
folder: poison-pill
|
folder: poison-pill
|
||||||
permalink: /patterns/poison-pill/
|
permalink: /patterns/poison-pill/
|
||||||
categories: pattern_cat
|
categories: Other
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Poison Pill is known predefined data item that allows to provide
|
**Intent:** Poison Pill is known predefined data item that allows to provide
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Private Class Data
|
title: Private Class Data
|
||||||
folder: private-class-data
|
folder: private-class-data
|
||||||
permalink: /patterns/private-class-data/
|
permalink: /patterns/private-class-data/
|
||||||
categories: pattern_cat
|
categories: Other
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Private Class Data design pattern seeks to reduce exposure of
|
**Intent:** Private Class Data design pattern seeks to reduce exposure of
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Property
|
title: Property
|
||||||
folder: property
|
folder: property
|
||||||
permalink: /patterns/property/
|
permalink: /patterns/property/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Create hierarchy of objects and new objects using already existing
|
**Intent:** Create hierarchy of objects and new objects using already existing
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Prototype
|
title: Prototype
|
||||||
folder: prototype
|
folder: prototype
|
||||||
permalink: /patterns/prototype/
|
permalink: /patterns/prototype/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Specify the kinds of objects to create using a prototypical
|
**Intent:** Specify the kinds of objects to create using a prototypical
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Proxy
|
title: Proxy
|
||||||
folder: proxy
|
folder: proxy
|
||||||
permalink: /patterns/proxy/
|
permalink: /patterns/proxy/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Provide a surrogate or placeholder for another object to control
|
**Intent:** Provide a surrogate or placeholder for another object to control
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Repository
|
title: Repository
|
||||||
folder: repository
|
folder: repository
|
||||||
permalink: /patterns/repository/
|
permalink: /patterns/repository/
|
||||||
categories: architectural
|
categories: Architectural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Repository layer is added between the domain and data mapping
|
**Intent:** Repository layer is added between the domain and data mapping
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Resource Acquisition Is Initialization
|
title: Resource Acquisition Is Initialization
|
||||||
folder: resource-acquisition-is-initialization
|
folder: resource-acquisition-is-initialization
|
||||||
permalink: /patterns/resource-acquisition-is-initialization/
|
permalink: /patterns/resource-acquisition-is-initialization/
|
||||||
categories: pattern_cat
|
categories: Other
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Resource Acquisition Is Initialization pattern can be used to implement exception safe resource management.
|
**Intent:** Resource Acquisition Is Initialization pattern can be used to implement exception safe resource management.
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Servant
|
title: Servant
|
||||||
folder: servant
|
folder: servant
|
||||||
permalink: /patterns/servant/
|
permalink: /patterns/servant/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Servant is used for providing some behavior to a group of classes.
|
**Intent:** Servant is used for providing some behavior to a group of classes.
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Service Layer
|
title: Service Layer
|
||||||
folder: service-layer
|
folder: service-layer
|
||||||
permalink: /patterns/service-layer/
|
permalink: /patterns/service-layer/
|
||||||
categories: architectural
|
categories: Architectural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Service Layer is an abstraction over domain logic. Typically
|
**Intent:** Service Layer is an abstraction over domain logic. Typically
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Service Locator
|
title: Service Locator
|
||||||
folder: service-locator
|
folder: service-locator
|
||||||
permalink: /patterns/service-locator/
|
permalink: /patterns/service-locator/
|
||||||
categories: structural
|
categories: Structural
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Encapsulate the processes involved in obtaining a service with a
|
**Intent:** Encapsulate the processes involved in obtaining a service with a
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Singleton
|
title: Singleton
|
||||||
folder: singleton
|
folder: singleton
|
||||||
permalink: /patterns/singleton/
|
permalink: /patterns/singleton/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Ensure a class only has one instance, and provide a global point of
|
**Intent:** Ensure a class only has one instance, and provide a global point of
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Specification
|
title: Specification
|
||||||
folder: specification
|
folder: specification
|
||||||
permalink: /patterns/specification/
|
permalink: /patterns/specification/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Specification pattern separates the statement of how to match a
|
**Intent:** Specification pattern separates the statement of how to match a
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: State
|
title: State
|
||||||
folder: state
|
folder: state
|
||||||
permalink: /patterns/state/
|
permalink: /patterns/state/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Allow an object to alter its behavior when its internal state
|
**Intent:** Allow an object to alter its behavior when its internal state
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Step Builder
|
title: Step Builder
|
||||||
folder: step-builder
|
folder: step-builder
|
||||||
permalink: /patterns/step-builder/
|
permalink: /patterns/step-builder/
|
||||||
categories: creational
|
categories: Creational
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** An extension of the Builder pattern that fully guides the user through the creation of the object with no chances of confusion.
|
**Intent:** An extension of the Builder pattern that fully guides the user through the creation of the object with no chances of confusion.
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Strategy
|
title: Strategy
|
||||||
folder: strategy
|
folder: strategy
|
||||||
permalink: /patterns/strategy/
|
permalink: /patterns/strategy/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Define a family of algorithms, encapsulate each one, and make them
|
**Intent:** Define a family of algorithms, encapsulate each one, and make them
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Template method
|
title: Template method
|
||||||
folder: template-method
|
folder: template-method
|
||||||
permalink: /patterns/template-method/
|
permalink: /patterns/template-method/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Define the skeleton of an algorithm in an operation, deferring some
|
**Intent:** Define the skeleton of an algorithm in an operation, deferring some
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Thread Pool
|
title: Thread Pool
|
||||||
folder: thread-pool
|
folder: thread-pool
|
||||||
permalink: /patterns/thread-pool/
|
permalink: /patterns/thread-pool/
|
||||||
categories: concurrency
|
categories: Concurrency
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** It is often the case that tasks to be executed are short-lived and
|
**Intent:** It is often the case that tasks to be executed are short-lived and
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Tolerant Reader
|
title: Tolerant Reader
|
||||||
folder: tolerant-reader
|
folder: tolerant-reader
|
||||||
permalink: /patterns/tolerant-reader/
|
permalink: /patterns/tolerant-reader/
|
||||||
categories: integration
|
categories: Integration
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Tolerant Reader is an integration pattern that helps creating
|
**Intent:** Tolerant Reader is an integration pattern that helps creating
|
||||||
|
@ -3,8 +3,8 @@ layout: pattern
|
|||||||
title: Visitor
|
title: Visitor
|
||||||
folder: visitor
|
folder: visitor
|
||||||
permalink: /patterns/visitor/
|
permalink: /patterns/visitor/
|
||||||
categories: behavioral
|
categories: Behavioral
|
||||||
tags: pattern_tag
|
tags: Java
|
||||||
---
|
---
|
||||||
|
|
||||||
**Intent:** Represent an operation to be performed on the elements of an object
|
**Intent:** Represent an operation to be performed on the elements of an object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user