https://github.com/iluwatar/java-design-patterns-web/issues/8 Update pattern categories and tags
This commit is contained in:
parent
0335c61512
commit
b2b1ba95eb
@ -5,8 +5,7 @@ folder: abstract-document
|
|||||||
permalink: /patterns/abstract-document/
|
permalink: /patterns/abstract-document/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: abstract-factory
|
|||||||
permalink: /patterns/abstract-factory/
|
permalink: /patterns/abstract-factory/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -5,8 +5,7 @@ folder: acyclic-visitor
|
|||||||
permalink: /patterns/acyclic-visitor/
|
permalink: /patterns/acyclic-visitor/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: adapter
|
|||||||
permalink: /patterns/adapter/
|
permalink: /patterns/adapter/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -5,8 +5,7 @@ folder: aggregator-microservices
|
|||||||
permalink: /patterns/aggregator-microservices/
|
permalink: /patterns/aggregator-microservices/
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Cloud distributed
|
||||||
- Spring
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,7 @@ folder: ambassador
|
|||||||
permalink: /patterns/ambassador/
|
permalink: /patterns/ambassador/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,8 @@ folder: api-gateway
|
|||||||
permalink: /patterns/api-gateway/
|
permalink: /patterns/api-gateway/
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Cloud distributed
|
||||||
- Difficulty-Intermediate
|
- Decoupling
|
||||||
- Spring
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,6 @@ folder: async-method-invocation
|
|||||||
permalink: /patterns/async-method-invocation/
|
permalink: /patterns/async-method-invocation/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Functional
|
|
||||||
- Reactive
|
- Reactive
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ folder: balking
|
|||||||
permalink: /patterns/balking/
|
permalink: /patterns/balking/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: bridge
|
|||||||
permalink: /patterns/bridge/
|
permalink: /patterns/bridge/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -5,9 +5,7 @@ folder: builder
|
|||||||
permalink: /patterns/builder/
|
permalink: /patterns/builder/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ 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: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,7 @@ folder: bytecode
|
|||||||
permalink: /patterns/bytecode/
|
permalink: /patterns/bytecode/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Game programming
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,8 @@ layout: pattern
|
|||||||
title: Caching
|
title: Caching
|
||||||
folder: caching
|
folder: caching
|
||||||
permalink: /patterns/caching/
|
permalink: /patterns/caching/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -3,12 +3,9 @@ layout: pattern
|
|||||||
title: Callback
|
title: Callback
|
||||||
folder: callback
|
folder: callback
|
||||||
permalink: /patterns/callback/
|
permalink: /patterns/callback/
|
||||||
categories: Other
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Reactive
|
||||||
- Difficulty-Beginner
|
|
||||||
- Functional
|
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: chain
|
|||||||
permalink: /patterns/chain/
|
permalink: /patterns/chain/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,11 +3,10 @@ layout: pattern
|
|||||||
title: Circuit Breaker
|
title: Circuit Breaker
|
||||||
folder: circuit-breaker
|
folder: circuit-breaker
|
||||||
permalink: /patterns/circuit-breaker/
|
permalink: /patterns/circuit-breaker/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Performance
|
- Performance
|
||||||
- Difficulty-Intermediate
|
- Decoupling
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -179,6 +178,7 @@ Use the Circuit Breaker pattern when
|
|||||||
- [Retry Pattern](https://github.com/iluwatar/java-design-patterns/tree/master/retry)
|
- [Retry Pattern](https://github.com/iluwatar/java-design-patterns/tree/master/retry)
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
* [Spring Circuit Breaker module](https://spring.io/guides/gs/circuit-breaker)
|
* [Spring Circuit Breaker module](https://spring.io/guides/gs/circuit-breaker)
|
||||||
* [Netflix Hystrix API](https://github.com/Netflix/Hystrix)
|
* [Netflix Hystrix API](https://github.com/Netflix/Hystrix)
|
||||||
|
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Collection Pipeline
|
title: Collection Pipeline
|
||||||
folder: collection-pipeline
|
folder: collection-pipeline
|
||||||
permalink: /patterns/collection-pipeline/
|
permalink: /patterns/collection-pipeline/
|
||||||
categories: Other
|
categories: Functional
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Reactive
|
||||||
- Difficulty-Beginner
|
|
||||||
- Functional
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -28,4 +26,4 @@ Use the Collection Pipeline pattern when
|
|||||||
|
|
||||||
* [Function composition and the Collection Pipeline pattern](https://www.ibm.com/developerworks/library/j-java8idioms2/index.html)
|
* [Function composition and the Collection Pipeline pattern](https://www.ibm.com/developerworks/library/j-java8idioms2/index.html)
|
||||||
* [Martin Fowler](https://martinfowler.com/articles/collection-pipeline/)
|
* [Martin Fowler](https://martinfowler.com/articles/collection-pipeline/)
|
||||||
* [Java8 Streams](https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html)
|
* [Java8 Streams](https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html)
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Combinator
|
title: Combinator
|
||||||
folder: combinator
|
folder: combinator
|
||||||
permalink: /patterns/combinator/
|
permalink: /patterns/combinator/
|
||||||
categories: Behavioral
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Functional
|
|
||||||
- Reactive
|
- Reactive
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
@ -23,13 +21,16 @@ and some "combinators" which can combine values of type T in various ways to bui
|
|||||||
|
|
||||||
## Applicability
|
## Applicability
|
||||||
Use the combinator pattern when:
|
Use the combinator pattern when:
|
||||||
|
|
||||||
- You are able to create a more complex value from more plain values but having the same type(a combination of them)
|
- You are able to create a more complex value from more plain values but having the same type(a combination of them)
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
- java.util.function.Function#compose
|
- java.util.function.Function#compose
|
||||||
- java.util.function.Function#andThen
|
- java.util.function.Function#andThen
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
- [Example for java](https://gtrefs.github.io/code/combinator-pattern/)
|
- [Example for java](https://gtrefs.github.io/code/combinator-pattern/)
|
||||||
- [Combinator pattern](https://wiki.haskell.org/Combinator_pattern)
|
- [Combinator pattern](https://wiki.haskell.org/Combinator_pattern)
|
||||||
- [Combinatory logic](https://wiki.haskell.org/Combinatory_logic)
|
- [Combinatory logic](https://wiki.haskell.org/Combinatory_logic)
|
||||||
|
@ -5,10 +5,7 @@ folder: command
|
|||||||
permalink: /patterns/command/
|
permalink: /patterns/command/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Functional
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Commander
|
title: Commander
|
||||||
folder: commander
|
folder: commander
|
||||||
permalink: /patterns/commander/
|
permalink: /patterns/commander/
|
||||||
categories: Other
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Cloud distributed
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -24,4 +23,5 @@ Handling distributed transactions can be tricky, but if we choose to not handle
|
|||||||
We need a mechanism in place which can handle these kinds of situations. We have to direct the order to either one of the services (in this example, shipping) and then add the order into the database of the other service (in this example, payment), since two databses cannot be updated atomically. If currently unable to do it, there should be a queue where this request can be queued, and there has to be a mechanism which allows for a failure in the queueing as well. All this needs to be done by constant retries while ensuring idempotence (even if the request is made several times, the change should only be applied once) by a commander class, to reach a state of eventual consistency.
|
We need a mechanism in place which can handle these kinds of situations. We have to direct the order to either one of the services (in this example, shipping) and then add the order into the database of the other service (in this example, payment), since two databses cannot be updated atomically. If currently unable to do it, there should be a queue where this request can be queued, and there has to be a mechanism which allows for a failure in the queueing as well. All this needs to be done by constant retries while ensuring idempotence (even if the request is made several times, the change should only be applied once) by a commander class, to reach a state of eventual consistency.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [https://www.grahamlea.com/2016/08/distributed-transactions-microservices-icebergs/]
|
* [https://www.grahamlea.com/2016/08/distributed-transactions-microservices-icebergs/]
|
||||||
|
@ -5,9 +5,7 @@ folder: composite
|
|||||||
permalink: /patterns/composite/
|
permalink: /patterns/composite/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Converter
|
title: Converter
|
||||||
folder: converter
|
folder: converter
|
||||||
permalink: /patterns/converter/
|
permalink: /patterns/converter/
|
||||||
categories: Business Tier
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,8 @@ folder: cqrs
|
|||||||
permalink: /patterns/cqrs/
|
permalink: /patterns/cqrs/
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Performance
|
||||||
- Difficulty-Intermediate
|
- Cloud distributed
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Data Access Object
|
title: Data Access Object
|
||||||
folder: dao
|
folder: dao
|
||||||
permalink: /patterns/dao/
|
permalink: /patterns/dao/
|
||||||
categories: Persistence Tier
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Data access
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -6,8 +6,7 @@ permalink: /patterns/data-bus/
|
|||||||
|
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Data Locality
|
title: Data Locality
|
||||||
folder: data-locality
|
folder: data-locality
|
||||||
permalink: /patterns/data-locality/
|
permalink: /patterns/data-locality/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Game programming
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Data Mapper
|
title: Data Mapper
|
||||||
folder: data-mapper
|
folder: data-mapper
|
||||||
permalink: /patterns/data-mapper/
|
permalink: /patterns/data-mapper/
|
||||||
categories: Persistence Tier
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,10 +5,7 @@ folder: data-transfer-object
|
|||||||
permalink: /patterns/data-transfer-object/
|
permalink: /patterns/data-transfer-object/
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Performance
|
||||||
- KISS
|
|
||||||
- YAGNI
|
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,8 @@ folder: decorator
|
|||||||
permalink: /patterns/decorator/
|
permalink: /patterns/decorator/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Beginner
|
- Extensibility
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Delegation
|
title: Delegation
|
||||||
folder: delegation
|
folder: delegation
|
||||||
permalink: /patterns/delegation/
|
permalink: /patterns/delegation/
|
||||||
categories: Behavioral
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -3,10 +3,9 @@ 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: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Dirty Flag
|
title: Dirty Flag
|
||||||
folder: dirty-flag
|
folder: dirty-flag
|
||||||
permalink: /patterns/dirty-flag/
|
permalink: /patterns/dirty-flag/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Game programming
|
||||||
- Difficulty-Beginner
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@ layout: pattern
|
|||||||
title: Double Buffer
|
title: Double Buffer
|
||||||
folder: double-buffer
|
folder: double-buffer
|
||||||
permalink: /patterns/double-buffer/
|
permalink: /patterns/double-buffer/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Performance
|
||||||
- Difficulty-Beginner
|
- Game programming
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -19,11 +19,8 @@ Double buffering is a term used to describe a device that has two buffers. The u
|
|||||||
This pattern is one of those ones where you’ll know when you need it. If you have a system that lacks double buffering, it will probably look visibly wrong (tearing, etc.) or will behave incorrectly. But saying, “you’ll know when you need it” doesn’t give you much to go on. More specifically, this pattern is appropriate when all of these are true:
|
This pattern is one of those ones where you’ll know when you need it. If you have a system that lacks double buffering, it will probably look visibly wrong (tearing, etc.) or will behave incorrectly. But saying, “you’ll know when you need it” doesn’t give you much to go on. More specifically, this pattern is appropriate when all of these are true:
|
||||||
|
|
||||||
- We have some state that is being modified incrementally.
|
- We have some state that is being modified incrementally.
|
||||||
|
|
||||||
- That same state may be accessed in the middle of modification.
|
- That same state may be accessed in the middle of modification.
|
||||||
|
|
||||||
- We want to prevent the code that’s accessing the state from seeing the work in progress.
|
- We want to prevent the code that’s accessing the state from seeing the work in progress.
|
||||||
|
|
||||||
- We want to be able to read the state and we don’t want to have to wait while it’s being written.
|
- We want to be able to read the state and we don’t want to have to wait while it’s being written.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
@ -3,11 +3,9 @@ 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: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Performance
|
||||||
- Difficulty-Beginner
|
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Double Dispatch
|
title: Double Dispatch
|
||||||
folder: double-dispatch
|
folder: double-dispatch
|
||||||
permalink: /patterns/double-dispatch/
|
permalink: /patterns/double-dispatch/
|
||||||
categories: Other
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: eip-aggregator
|
|||||||
permalink: /patterns/eip-aggregator/
|
permalink: /patterns/eip-aggregator/
|
||||||
categories: Integration
|
categories: Integration
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Enterprise Integration Pattern
|
||||||
- Difficulty-Intermittent
|
|
||||||
- EIP
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: eip-message-channel
|
|||||||
permalink: /patterns/eip-message-channel/
|
permalink: /patterns/eip-message-channel/
|
||||||
categories: Integration
|
categories: Integration
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Enterprise Integration Pattern
|
||||||
- EIP
|
|
||||||
- Apache Camel™
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: eip-publish-subscribe
|
|||||||
permalink: /patterns/eip-publish-subscribe/
|
permalink: /patterns/eip-publish-subscribe/
|
||||||
categories: Integration
|
categories: Integration
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Enterprise Integration Pattern
|
||||||
- EIP
|
|
||||||
- Apache Camel™
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: eip-splitter
|
|||||||
permalink: /patterns/eip-splitter/
|
permalink: /patterns/eip-splitter/
|
||||||
categories: Integration
|
categories: Integration
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Enterprise Integration Pattern
|
||||||
- Difficulty-Intermittent
|
|
||||||
- EIP
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: eip-wire-tap
|
|||||||
permalink: /patterns/eip-wire-tap/
|
permalink: /patterns/eip-wire-tap/
|
||||||
categories: Integration
|
categories: Integration
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Enterprise Integration Pattern
|
||||||
- Difficulty-Intermittent
|
|
||||||
- EIP
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,6 @@ folder: event-aggregator
|
|||||||
permalink: /patterns/event-aggregator/
|
permalink: /patterns/event-aggregator/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Beginner
|
|
||||||
- Reactive
|
- Reactive
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -5,9 +5,7 @@ folder: event-asynchronous
|
|||||||
permalink: /patterns/event-asynchronous/
|
permalink: /patterns/event-asynchronous/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- difficulty-intermediate
|
- Reactive
|
||||||
- performance
|
|
||||||
- Java
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,6 @@ folder: event-driven-architecture
|
|||||||
permalink: /patterns/event-driven-architecture/
|
permalink: /patterns/event-driven-architecture/
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Reactive
|
- Reactive
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -5,9 +5,7 @@ folder: event-queue
|
|||||||
permalink: /patterns/event-queue/
|
permalink: /patterns/event-queue/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Game programming
|
||||||
- Difficulty Intermediate
|
|
||||||
- Queue
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,6 @@ folder: event-sourcing
|
|||||||
permalink: /patterns/event-sourcing/
|
permalink: /patterns/event-sourcing/
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty Intermediate
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Execute Around
|
title: Execute Around
|
||||||
folder: execute-around
|
folder: execute-around
|
||||||
permalink: /patterns/execute-around/
|
permalink: /patterns/execute-around/
|
||||||
categories: Other
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Beginner
|
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -25,4 +23,5 @@ Use the Execute Around idiom when
|
|||||||
* you use an API that requires methods to be called in pairs such as open/close or allocate/deallocate.
|
* you use an API that requires methods to be called in pairs such as open/close or allocate/deallocate.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions](http://www.amazon.com/Functional-Programming-Java-Harnessing-Expressions/dp/1937785467/ref=sr_1_1)
|
* [Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions](http://www.amazon.com/Functional-Programming-Java-Harnessing-Expressions/dp/1937785467/ref=sr_1_1)
|
||||||
|
@ -5,8 +5,7 @@ folder: extension-objects
|
|||||||
permalink: /patterns/extension-objects/
|
permalink: /patterns/extension-objects/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,8 @@ folder: facade
|
|||||||
permalink: /patterns/facade/
|
permalink: /patterns/facade/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Beginner
|
- Decoupling
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: factory-kit
|
|||||||
permalink: /patterns/factory-kit/
|
permalink: /patterns/factory-kit/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Beginner
|
|
||||||
- Functional
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,7 @@ folder: factory-method
|
|||||||
permalink: /patterns/factory-method/
|
permalink: /patterns/factory-method/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Beginner
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ folder: feature-toggle
|
|||||||
permalink: /patterns/feature-toggle/
|
permalink: /patterns/feature-toggle/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Fluent Interface
|
title: Fluent Interface
|
||||||
folder: fluentinterface
|
folder: fluentinterface
|
||||||
permalink: /patterns/fluentinterface/
|
permalink: /patterns/fluentinterface/
|
||||||
categories: Other
|
categories: Functional
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Reactive
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Functional
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Flux
|
title: Flux
|
||||||
folder: flux
|
folder: flux
|
||||||
permalink: /patterns/flux/
|
permalink: /patterns/flux/
|
||||||
categories: Presentation Tier
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: flyweight
|
|||||||
permalink: /patterns/flyweight/
|
permalink: /patterns/flyweight/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ 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: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Game Loop
|
title: Game Loop
|
||||||
folder: game-loop
|
folder: game-loop
|
||||||
permalink: /patterns/game-loop/
|
permalink: /patterns/game-loop/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Game programming
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,8 +5,7 @@ folder: guarded-suspension
|
|||||||
permalink: /patterns/guarded-suspension/
|
permalink: /patterns/guarded-suspension/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -19,4 +18,5 @@ Use Guarded suspension pattern to handle a situation when you want to execute a
|
|||||||
Use Guarded Suspension pattern when the developer knows that the method execution will be blocked for a finite period of time
|
Use Guarded Suspension pattern when the developer knows that the method execution will be blocked for a finite period of time
|
||||||
|
|
||||||
## Related patterns
|
## Related patterns
|
||||||
|
|
||||||
* Balking
|
* Balking
|
||||||
|
@ -5,8 +5,7 @@ folder: half-sync-half-async
|
|||||||
permalink: /patterns/half-sync-half-async/
|
permalink: /patterns/half-sync-half-async/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Performance
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -6,11 +6,11 @@ permalink: /patterns/hexagonal/
|
|||||||
pumlformat: svg
|
pumlformat: svg
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Expert
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
|
||||||
* Ports and Adapters
|
* Ports and Adapters
|
||||||
* Clean Architecture
|
* Clean Architecture
|
||||||
* Onion Architecture
|
* Onion Architecture
|
||||||
@ -28,6 +28,7 @@ Use Hexagonal Architecture pattern when
|
|||||||
* When it is important that the application highly maintainable and fully testable
|
* When it is important that the application highly maintainable and fully testable
|
||||||
|
|
||||||
## Tutorials
|
## Tutorials
|
||||||
|
|
||||||
* [Build Maintainable Systems With Hexagonal Architecture](http://java-design-patterns.com/blog/build-maintainable-systems-with-hexagonal-architecture/)
|
* [Build Maintainable Systems With Hexagonal Architecture](http://java-design-patterns.com/blog/build-maintainable-systems-with-hexagonal-architecture/)
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
@ -5,8 +5,7 @@ folder: intercepting-filter
|
|||||||
permalink: /patterns/intercepting-filter/
|
permalink: /patterns/intercepting-filter/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -24,6 +23,7 @@ Use the Intercepting Filter pattern when
|
|||||||
* you want a modular approach to configuring pre-processing and post-processing schemes
|
* you want a modular approach to configuring pre-processing and post-processing schemes
|
||||||
|
|
||||||
## Tutorials
|
## Tutorials
|
||||||
|
|
||||||
* [Introduction to Intercepting Filter Pattern in Java](https://www.baeldung.com/intercepting-filter-pattern-in-java)
|
* [Introduction to Intercepting Filter Pattern in Java](https://www.baeldung.com/intercepting-filter-pattern-in-java)
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
@ -5,9 +5,7 @@ folder: interpreter
|
|||||||
permalink: /patterns/interpreter/
|
permalink: /patterns/interpreter/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -27,6 +25,7 @@ trees. The Interpreter pattern works best when
|
|||||||
* efficiency is not a critical concern. The most efficient interpreters are usually not implemented by interpreting parse trees directly but by first translating them into another form. For example, regular expressions are often transformed into state machines. But even then, the translator can be implemented by the Interpreter pattern, so the pattern is still applicable
|
* efficiency is not a critical concern. The most efficient interpreters are usually not implemented by interpreting parse trees directly but by first translating them into another form. For example, regular expressions are often transformed into state machines. But even then, the translator can be implemented by the Interpreter pattern, so the pattern is still applicable
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
* [java.util.Pattern](http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html)
|
* [java.util.Pattern](http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html)
|
||||||
* [java.text.Normalizer](http://docs.oracle.com/javase/8/docs/api/java/text/Normalizer.html)
|
* [java.text.Normalizer](http://docs.oracle.com/javase/8/docs/api/java/text/Normalizer.html)
|
||||||
* All subclasses of [java.text.Format](http://docs.oracle.com/javase/8/docs/api/java/text/Format.html)
|
* All subclasses of [java.text.Format](http://docs.oracle.com/javase/8/docs/api/java/text/Format.html)
|
||||||
|
@ -5,8 +5,6 @@ folder: iterator
|
|||||||
permalink: /patterns/iterator/
|
permalink: /patterns/iterator/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Beginner
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -6,9 +6,7 @@ permalink: /patterns/layers/
|
|||||||
pumlformat: svg
|
pumlformat: svg
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Spring
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,11 +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: Other
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Beginner
|
|
||||||
- Idiom
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Leader Election
|
title: Leader Election
|
||||||
folder: leader-election
|
folder: leader-election
|
||||||
permalink: /patterns/leader-election/
|
permalink: /patterns/leader-election/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Cloud distributed
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Marker Interface
|
title: Marker Interface
|
||||||
folder: marker
|
folder: marker
|
||||||
permalink: /patterns/marker/
|
permalink: /patterns/marker/
|
||||||
categories: Other
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Master-Worker
|
title: Master-Worker
|
||||||
folder: master-worker-pattern
|
folder: master-worker-pattern
|
||||||
permalink: /patterns/master-worker-pattern/
|
permalink: /patterns/master-worker-pattern/
|
||||||
categories: Other
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Performance
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
@ -27,5 +26,6 @@ This pattern can be used when data can be divided into multiple parts, all of wh
|
|||||||
In this pattern, parallel processing is performed using a system consisting of a master and some number of workers, where a master divides the work among the workers, gets the result back from them and assimilates all the results to give final result. The only communication is between the master and the worker - none of the workers communicate among one another and the user only communicates with the master to get the required job done. The master has to maintain a record of how the divided data has been distributed, how many workers have finished their work and returned a result, and the results themselves to be able to aggregate the data correctly.
|
In this pattern, parallel processing is performed using a system consisting of a master and some number of workers, where a master divides the work among the workers, gets the result back from them and assimilates all the results to give final result. The only communication is between the master and the worker - none of the workers communicate among one another and the user only communicates with the master to get the required job done. The master has to maintain a record of how the divided data has been distributed, how many workers have finished their work and returned a result, and the results themselves to be able to aggregate the data correctly.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [https://docs.gigaspaces.com/sbp/master-worker-pattern.html]
|
* [https://docs.gigaspaces.com/sbp/master-worker-pattern.html]
|
||||||
* [http://www.cs.sjsu.edu/~pearce/oom/patterns/behavioral/masterslave.htm]
|
* [http://www.cs.sjsu.edu/~pearce/oom/patterns/behavioral/masterslave.htm]
|
||||||
|
@ -5,9 +5,8 @@ folder: mediator
|
|||||||
permalink: /patterns/mediator/
|
permalink: /patterns/mediator/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
- Decoupling
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: memento
|
|||||||
permalink: /patterns/memento/
|
permalink: /patterns/memento/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -3,10 +3,9 @@ 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: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -21,7 +20,7 @@ display.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Model-View-Controller pattern when
|
Use the Model-View-Controller pattern when
|
||||||
|
|
||||||
* you want to clearly separate the domain data from its user interface representation
|
* You want to clearly separate the domain data from its user interface representation
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ 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: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -20,8 +19,8 @@ developers to build and test user interfaces.
|
|||||||
Use the Model-View-Presenter in any of the following
|
Use the Model-View-Presenter in any of the following
|
||||||
situations
|
situations
|
||||||
|
|
||||||
* when you want to improve the "Separation of Concerns" principle in presentation logic
|
* When you want to improve the "Separation of Concerns" principle in presentation logic
|
||||||
* when a user interface development and testing is necessary.
|
* When a user interface development and testing is necessary.
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Module
|
title: Module
|
||||||
folder: module
|
folder: module
|
||||||
permalink: /patterns/module/
|
permalink: /patterns/module/
|
||||||
categories: Creational Pattern
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Monad
|
title: Monad
|
||||||
folder: monad
|
folder: monad
|
||||||
permalink: /patterns/monad/
|
permalink: /patterns/monad/
|
||||||
categories: Other
|
categories: Functional
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Reactive
|
||||||
- Difficulty-Expert
|
|
||||||
- Functional
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -26,8 +24,8 @@ return - that takes plain type object and returns this object wrapped in a monad
|
|||||||
|
|
||||||
Use the Monad in any of the following situations
|
Use the Monad in any of the following situations
|
||||||
|
|
||||||
* when you want to chain operations easily
|
* When you want to chain operations easily
|
||||||
* when you want to apply each function regardless of the result of any of them
|
* When you want to apply each function regardless of the result of any of them
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ folder: monostate
|
|||||||
permalink: /patterns/monostate/
|
permalink: /patterns/monostate/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Instantiation
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
@ -27,9 +26,9 @@ Use the Monostate pattern when
|
|||||||
|
|
||||||
## Typical Use Case
|
## Typical Use Case
|
||||||
|
|
||||||
* the logging class
|
* The logging class
|
||||||
* managing a connection to a database
|
* Managing a connection to a database
|
||||||
* file manager
|
* File manager
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ folder: multiton
|
|||||||
permalink: /patterns/multiton/
|
permalink: /patterns/multiton/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Instantiation
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Mute Idiom
|
title: Mute Idiom
|
||||||
folder: mute-idiom
|
folder: mute-idiom
|
||||||
permalink: /patterns/mute-idiom/
|
permalink: /patterns/mute-idiom/
|
||||||
categories: Other
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,13 +5,13 @@ folder: mutex
|
|||||||
permalink: /patterns/mutex/
|
permalink: /patterns/mutex/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
Mutual Exclusion Lock
|
|
||||||
Binary Semaphore
|
* Mutual Exclusion Lock
|
||||||
|
* Binary Semaphore
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
Create a lock which only allows a single thread to access a resource at any one instant.
|
Create a lock which only allows a single thread to access a resource at any one instant.
|
||||||
@ -22,8 +22,8 @@ Create a lock which only allows a single thread to access a resource at any one
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use a Mutex when
|
Use a Mutex when
|
||||||
|
|
||||||
* you need to prevent two threads accessing a critical section at the same time
|
* You need to prevent two threads accessing a critical section at the same time
|
||||||
* concurrent access to a resource could lead to a race condition
|
* Concurrent access to a resource could lead to a race condition
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ folder: naked-objects
|
|||||||
permalink: /patterns/naked-objects/
|
permalink: /patterns/naked-objects/
|
||||||
categories: Architectural
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Expert
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -20,9 +19,9 @@ everything else is autogenerated by the framework.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Naked Objects pattern when
|
Use the Naked Objects pattern when
|
||||||
|
|
||||||
* you are prototyping and need fast development cycle
|
* You are prototyping and need fast development cycle
|
||||||
* an autogenerated user interface is good enough
|
* An autogenerated user interface is good enough
|
||||||
* you want to automatically publish the domain as REST services
|
* You want to automatically publish the domain as REST services
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ folder: null-object
|
|||||||
permalink: /patterns/null-object/
|
permalink: /patterns/null-object/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Extensibility
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -25,7 +24,8 @@ Object is very predictable and has no side effects: it does nothing.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Null Object pattern when
|
Use the Null Object pattern when
|
||||||
|
|
||||||
* you want to avoid explicit null checks and keep the algorithm elegant and easy to read.
|
* You want to avoid explicit null checks and keep the algorithm elegant and easy to read.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [Pattern Languages of Program Design](http://www.amazon.com/Pattern-Languages-Program-Design-Coplien/dp/0201607344/ref=sr_1_1)
|
* [Pattern Languages of Program Design](http://www.amazon.com/Pattern-Languages-Program-Design-Coplien/dp/0201607344/ref=sr_1_1)
|
||||||
|
@ -5,8 +5,7 @@ folder: object-mother
|
|||||||
permalink: /patterns/object-mother/
|
permalink: /patterns/object-mother/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Instantiation
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Object Mother
|
## Object Mother
|
||||||
@ -19,13 +18,11 @@ Define a factory of immutable content with separated builder and factory interfa
|
|||||||
Use the Object Mother pattern when
|
Use the Object Mother pattern when
|
||||||
|
|
||||||
* You want consistent objects over several tests
|
* You want consistent objects over several tests
|
||||||
* you want to reduce code for creation of objects in tests
|
* You want to reduce code for creation of objects in tests
|
||||||
* every test should run with fresh data
|
* Every test should run with fresh data
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [Answer by David Brown](http://stackoverflow.com/questions/923319/what-is-an-objectmother) to the stackoverflow question: [What is an ObjectMother?](http://stackoverflow.com/questions/923319/what-is-an-objectmother)
|
* [Answer by David Brown](http://stackoverflow.com/questions/923319/what-is-an-objectmother) to the stackoverflow question: [What is an ObjectMother?](http://stackoverflow.com/questions/923319/what-is-an-objectmother)
|
||||||
|
|
||||||
* [c2wiki - Object Mother](http://c2.com/cgi/wiki?ObjectMother)
|
* [c2wiki - Object Mother](http://c2.com/cgi/wiki?ObjectMother)
|
||||||
|
|
||||||
* [Nat Pryce - Test Data Builders: an alternative to the Object Mother pattern](http://www.natpryce.com/articles/000714.html)
|
* [Nat Pryce - Test Data Builders: an alternative to the Object Mother pattern](http://www.natpryce.com/articles/000714.html)
|
||||||
|
@ -5,8 +5,7 @@ folder: object-pool
|
|||||||
permalink: /patterns/object-pool/
|
permalink: /patterns/object-pool/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Game programming
|
||||||
- Difficulty-Beginner
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -22,5 +21,5 @@ are in use and which are available.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Object Pool pattern when
|
Use the Object Pool pattern when
|
||||||
|
|
||||||
* the objects are expensive to create (allocation cost)
|
* The objects are expensive to create (allocation cost)
|
||||||
* you need a large number of short-lived objects (memory fragmentation)
|
* You need a large number of short-lived objects (memory fragmentation)
|
||||||
|
@ -5,8 +5,6 @@ folder: observer
|
|||||||
permalink: /patterns/observer/
|
permalink: /patterns/observer/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Beginner
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Reactive
|
- Reactive
|
||||||
---
|
---
|
||||||
@ -25,13 +23,13 @@ automatically.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Observer pattern in any of the following situations
|
Use the Observer pattern in any of the following situations
|
||||||
|
|
||||||
* when an abstraction has two aspects, one dependent on the other. Encapsulating these aspects in separate objects lets you vary and reuse them independently
|
* When an abstraction has two aspects, one dependent on the other. Encapsulating these aspects in separate objects lets you vary and reuse them independently
|
||||||
* when a change to one object requires changing others, and you don't know how many objects need to be changed
|
* When a change to one object requires changing others, and you don't know how many objects need to be changed
|
||||||
* when an object should be able to notify other objects without making assumptions about who these objects are. In other words, you don't want these objects tightly coupled
|
* When an object should be able to notify other objects without making assumptions about who these objects are. In other words, you don't want these objects tightly coupled
|
||||||
|
|
||||||
## Typical Use Case
|
## Typical Use Case
|
||||||
|
|
||||||
* changing in one object leads to a change in other objects
|
* Changing in one object leads to a change in other objects
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Page Object
|
title: Page Object
|
||||||
folder: page-object
|
folder: page-object
|
||||||
permalink: /patterns/page-object/
|
permalink: /patterns/page-object/
|
||||||
categories: Testing
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,12 +3,9 @@ layout: pattern
|
|||||||
title: Partial Response
|
title: Partial Response
|
||||||
folder: partial-response
|
folder: partial-response
|
||||||
permalink: /patterns/partial-response/
|
permalink: /patterns/partial-response/
|
||||||
categories: Architectural
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- KISS
|
|
||||||
- YAGNI
|
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -5,9 +5,7 @@ folder: pipeline
|
|||||||
permalink: /patterns/pipeline/
|
permalink: /patterns/pipeline/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Functional
|
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -19,13 +17,13 @@ Allows processing of data in a series of stages by giving in an initial input an
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Pipeline pattern when you want to
|
Use the Pipeline pattern when you want to
|
||||||
|
|
||||||
* execute individual stages that yields a final value
|
* Execute individual stages that yields a final value
|
||||||
* add readability to complex sequence of operations by providing a fluent builder as an interface
|
* Add readability to complex sequence of operations by providing a fluent builder as an interface
|
||||||
* improve testability of code since stages will most likely be doing a single thing, complying to the [Single Responsibility Principle (SRP)](https://java-design-patterns.com/principles/#single-responsibility-principle)
|
* Improve testability of code since stages will most likely be doing a single thing, complying to the [Single Responsibility Principle (SRP)](https://java-design-patterns.com/principles/#single-responsibility-principle)
|
||||||
|
|
||||||
## Typical Use Case
|
## Typical Use Case
|
||||||
|
|
||||||
* implement stages and execute them in an ordered manner
|
* Implement stages and execute them in an ordered manner
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Poison Pill
|
title: Poison Pill
|
||||||
folder: poison-pill
|
folder: poison-pill
|
||||||
permalink: /patterns/poison-pill/
|
permalink: /patterns/poison-pill/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Cloud distributed
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Reactive
|
- Reactive
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -20,7 +19,7 @@ graceful shutdown for separate distributed consumption process.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Poison Pill idiom when
|
Use the Poison Pill idiom when
|
||||||
|
|
||||||
* need to send signal from one thread/process to another to terminate
|
* Need to send signal from one thread/process to another to terminate
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ folder: priority-queue
|
|||||||
permalink: /patterns/priority-queue/
|
permalink: /patterns/priority-queue/
|
||||||
categories: Behavioral
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
@ -3,11 +3,9 @@ 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: Other
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Data access
|
||||||
- Difficulty-Beginner
|
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -21,4 +19,4 @@ attributes by encapsulating them in single Data object.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Private Class Data pattern when
|
Use the Private Class Data pattern when
|
||||||
|
|
||||||
* you want to prevent write access to class data members
|
* You want to prevent write access to class data members
|
||||||
|
@ -5,9 +5,6 @@ folder: producer-consumer
|
|||||||
permalink: /patterns/producer-consumer/
|
permalink: /patterns/producer-consumer/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Intermediate
|
|
||||||
- I/O
|
|
||||||
- Reactive
|
- Reactive
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -22,5 +19,5 @@ Producer Consumer Design pattern is a classic concurrency pattern which reduces
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Producer Consumer idiom when
|
Use the Producer Consumer idiom when
|
||||||
|
|
||||||
* decouple system by separate work in two process produce and consume.
|
* Decouple system by separate work in two process produce and consume.
|
||||||
* addresses the issue of different timing require to produce work or consuming work
|
* Addresses the issue of different timing require to produce work or consuming work
|
||||||
|
@ -5,10 +5,7 @@ folder: promise
|
|||||||
permalink: /patterns/promise/
|
permalink: /patterns/promise/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Functional
|
|
||||||
- Reactive
|
- Reactive
|
||||||
- Difficulty-Intermediate
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
@ -27,9 +24,9 @@ in a synchronous way.
|
|||||||
Promise pattern is applicable in concurrent programming when some work needs to be done asynchronously
|
Promise pattern is applicable in concurrent programming when some work needs to be done asynchronously
|
||||||
and:
|
and:
|
||||||
|
|
||||||
* code maintainability and readability suffers due to callback hell.
|
* Code maintainability and readability suffers due to callback hell.
|
||||||
* you need to compose promises and need better error handling for asynchronous tasks.
|
* You need to compose promises and need better error handling for asynchronous tasks.
|
||||||
* you want to use functional style of programming.
|
* You want to use functional style of programming.
|
||||||
|
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
@ -5,8 +5,7 @@ folder: property
|
|||||||
permalink: /patterns/property/
|
permalink: /patterns/property/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Instantiation
|
||||||
- Difficulty-Beginner
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -19,7 +18,7 @@ objects as parents.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Property pattern when
|
Use the Property pattern when
|
||||||
|
|
||||||
* when you like to have objects with dynamic set of fields and prototype inheritance
|
* When you like to have objects with dynamic set of fields and prototype inheritance
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -5,9 +5,8 @@ folder: prototype
|
|||||||
permalink: /patterns/prototype/
|
permalink: /patterns/prototype/
|
||||||
categories: Creational
|
categories: Creational
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Beginner
|
- Instantiation
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -68,10 +67,10 @@ System.out.println(cloned.getName()); // Dolly
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Prototype pattern when a system should be independent of how its products are created, composed and represented; and
|
Use the Prototype pattern when a system should be independent of how its products are created, composed and represented; and
|
||||||
|
|
||||||
* when the classes to instantiate are specified at run-time, for example, by dynamic loading
|
* When the classes to instantiate are specified at run-time, for example, by dynamic loading
|
||||||
* to avoid building a class hierarchy of factories that parallels the class hierarchy of products
|
* To avoid building a class hierarchy of factories that parallels the class hierarchy of products
|
||||||
* when instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state
|
* When instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state
|
||||||
* when object creation is expensive compared to cloning
|
* When object creation is expensive compared to cloning
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -5,9 +5,8 @@ folder: proxy
|
|||||||
permalink: /patterns/proxy/
|
permalink: /patterns/proxy/
|
||||||
categories: Structural
|
categories: Structural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Gang Of Four
|
- Gang Of Four
|
||||||
- Difficulty-Beginner
|
- Decoupling
|
||||||
---
|
---
|
||||||
|
|
||||||
## Also known as
|
## Also known as
|
||||||
@ -130,6 +129,7 @@ are several common situations in which the Proxy pattern is applicable
|
|||||||
* Count references to an object
|
* Count references to an object
|
||||||
|
|
||||||
## Tutorials
|
## Tutorials
|
||||||
|
|
||||||
* [Controlling Access With Proxy Pattern](http://java-design-patterns.com/blog/controlling-access-with-proxy-pattern/)
|
* [Controlling Access With Proxy Pattern](http://java-design-patterns.com/blog/controlling-access-with-proxy-pattern/)
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
@ -3,10 +3,9 @@ layout: pattern
|
|||||||
title: Queue based load leveling
|
title: Queue based load leveling
|
||||||
folder: queue-load-leveling
|
folder: queue-load-leveling
|
||||||
permalink: /patterns/queue-load-leveling/
|
permalink: /patterns/queue-load-leveling/
|
||||||
categories: Other
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Decoupling
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -6,9 +6,8 @@ permalink: /patterns/reactor/
|
|||||||
pumlformat: svg
|
pumlformat: svg
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Performance
|
||||||
- Difficulty-Expert
|
- Reactive
|
||||||
- I/O
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -20,9 +19,9 @@ The Reactor design pattern handles service requests that are delivered concurren
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use Reactor pattern when
|
Use Reactor pattern when
|
||||||
|
|
||||||
* a server application needs to handle concurrent service requests from multiple clients.
|
* A server application needs to handle concurrent service requests from multiple clients.
|
||||||
* a server application needs to be available for receiving requests from new clients even when handling older client requests.
|
* A server application needs to be available for receiving requests from new clients even when handling older client requests.
|
||||||
* a server must maximize throughput, minimize latency and use CPU efficiently without blocking.
|
* A server must maximize throughput, minimize latency and use CPU efficiently without blocking.
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -5,9 +5,6 @@ folder: reader-writer-lock
|
|||||||
permalink: /patterns/reader-writer-lock/
|
permalink: /patterns/reader-writer-lock/
|
||||||
categories: Concurrency
|
categories: Concurrency
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Intermediate
|
|
||||||
- I/O
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -29,5 +26,4 @@ Application need to increase the performance of resource synchronize for multip
|
|||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [Readers–writer lock](https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock)
|
* [Readers–writer lock](https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock)
|
||||||
|
* [Readers–writers_problem](https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem)
|
||||||
* [Readers–writers_problem](https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem)
|
|
||||||
|
@ -3,11 +3,9 @@ layout: pattern
|
|||||||
title: Repository
|
title: Repository
|
||||||
folder: repository
|
folder: repository
|
||||||
permalink: /patterns/repository/
|
permalink: /patterns/repository/
|
||||||
categories: Persistence Tier
|
categories: Architectural
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Data access
|
||||||
- Difficulty-Intermediate
|
|
||||||
- Spring
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -23,10 +21,10 @@ querying is utilized.
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Repository pattern when
|
Use the Repository pattern when
|
||||||
|
|
||||||
* the number of domain objects is large
|
* The number of domain objects is large
|
||||||
* you want to avoid duplication of query code
|
* You want to avoid duplication of query code
|
||||||
* you want to keep the database querying code in single place
|
* You want to keep the database querying code in single place
|
||||||
* you have multiple data sources
|
* You have multiple data sources
|
||||||
|
|
||||||
## Real world examples
|
## Real world examples
|
||||||
|
|
||||||
|
@ -3,11 +3,9 @@ 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: Other
|
categories: Idiom
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Data access
|
||||||
- Difficulty-Beginner
|
|
||||||
- Idiom
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
@ -19,4 +17,4 @@ Resource Acquisition Is Initialization pattern can be used to implement exceptio
|
|||||||
## Applicability
|
## Applicability
|
||||||
Use the Resource Acquisition Is Initialization pattern when
|
Use the Resource Acquisition Is Initialization pattern when
|
||||||
|
|
||||||
* you have resources that must be closed in every condition
|
* You have resources that must be closed in every condition
|
||||||
|
@ -3,10 +3,8 @@ layout: pattern
|
|||||||
title: Retry
|
title: Retry
|
||||||
folder: retry
|
folder: retry
|
||||||
permalink: /patterns/retry/
|
permalink: /patterns/retry/
|
||||||
categories: Other
|
categories: Behavioral
|
||||||
tags:
|
tags:
|
||||||
- Java
|
|
||||||
- Difficulty-Expert
|
|
||||||
- Performance
|
- Performance
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -151,4 +149,5 @@ You can view Microsoft's article [here](https://docs.microsoft.com/en-us/azure/a
|
|||||||
* Operations maintenance
|
* Operations maintenance
|
||||||
|
|
||||||
## Related Patterns
|
## Related Patterns
|
||||||
|
|
||||||
* [Circuit Breaker](https://martinfowler.com/bliki/CircuitBreaker.html)
|
* [Circuit Breaker](https://martinfowler.com/bliki/CircuitBreaker.html)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user