#1113 Link uml-reverse-mapper created class diagrams to readme, where needed
@ -12,6 +12,7 @@ tags:
|
||||
## Intent
|
||||
Achieve flexibility of untyped languages and keep the type-safety
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
|
||||
@ -26,4 +27,4 @@ Use the Abstract Document Pattern when
|
||||
## Credits
|
||||
|
||||
* [Wikipedia: Abstract Document Pattern](https://en.wikipedia.org/wiki/Abstract_Document_Pattern)
|
||||
* [Martin Fowler: Dealing with properties](http://martinfowler.com/apsupp/properties.pdf)
|
||||
* [Martin Fowler: Dealing with properties](http://martinfowler.com/apsupp/properties.pdf)
|
||||
|
@ -157,6 +157,9 @@ public static void main(String[] args) {
|
||||
}
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
|
||||
## Applicability
|
||||
Use the Abstract Factory pattern when
|
||||
|
BIN
abstract-factory/etc/abstract-factory.urm.png
Normal file
After Width: | Height: | Size: 80 KiB |
@ -9,11 +9,12 @@ tags:
|
||||
- Difficulty-Intermediate
|
||||
---
|
||||
|
||||

|
||||
|
||||
## Intent
|
||||
Allow new functions to be added to existing class hierarchies without affecting those hierarchies, and without creating the troublesome dependency cycles that are inherent to the GOF VISITOR Pattern.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
This pattern can be used:
|
||||
* When you need to add a new function to an existing hierarchy without the need to alter or affect that hierarchy.
|
||||
|
@ -97,6 +97,9 @@ var captain = new Captain(new FishingBoatAdapter());
|
||||
captain.row();
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Adapter pattern when
|
||||
|
||||
|
BIN
adapter/etc/adapter.urm.png
Normal file
After Width: | Height: | Size: 25 KiB |
@ -18,6 +18,8 @@ More variations of the aggregator are:
|
||||
- Chained Microservice Design Pattern: In this case each microservice is dependent/ chained to a series
|
||||
of other microservices.
|
||||
|
||||
## Class diagram
|
||||
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -150,6 +150,9 @@ public class App {
|
||||
}
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Ambassador is applicable when working with a legacy remote service that cannot
|
||||
be modified or would be extremely difficult to modify. Connectivity features can
|
||||
|
BIN
ambassador/etc/ambassador.urm.png
Normal file
After Width: | Height: | Size: 48 KiB |
@ -15,6 +15,7 @@ tags:
|
||||
Aggregate calls to microservices in a single location: the API Gateway. The user makes a single
|
||||
call to the API Gateway, and the API Gateway then calls each relevant microservice.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,6 +17,7 @@ is not blocked while waiting results of tasks. The pattern provides parallel
|
||||
processing of multiple independent tasks and retrieving the results via
|
||||
callbacks or waiting until everything is done.
|
||||
|
||||
# Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,7 @@ tags:
|
||||
Balking Pattern is used to prevent an object from executing certain code if it is an
|
||||
incomplete or inappropriate state
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -179,6 +179,9 @@ hammer.unwield();
|
||||
// The item's glow fades.
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Bridge pattern when
|
||||
|
||||
|
BIN
bridge/etc/bridge.urm.png
Normal file
After Width: | Height: | Size: 43 KiB |
@ -113,6 +113,9 @@ And then it can be used as:
|
||||
var mage = new Hero.Builder(Profession.MAGE, "Riobard").withHairColor(HairColor.BLACK).withWeapon(Weapon.DAGGER).build();
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Builder pattern when
|
||||
|
||||
|
BIN
builder/etc/builder.urm.png
Normal file
After Width: | Height: | Size: 93 KiB |
@ -15,6 +15,7 @@ presentation and business tiers. By using the pattern we gain loose coupling
|
||||
between the tiers and encapsulate knowledge about how to locate, connect to,
|
||||
and interact with the business objects that make up the application.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -12,6 +12,9 @@ tags:
|
||||
## Intent
|
||||
Allows to encode behaviour as instructions for virtual machine.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Bytecode pattern when you have a lot of behavior you need to define and your
|
||||
game’s implementation language isn’t a good fit because:
|
||||
|
BIN
bytecode/etc/bytecode.urm.png
Normal file
After Width: | Height: | Size: 67 KiB |
@ -15,6 +15,7 @@ To avoid expensive re-acquisition of resources by not releasing
|
||||
the resources immediately after their use. The resources retain their identity, are kept in some
|
||||
fast-access storage, and are re-used to avoid having to acquire them again.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -16,6 +16,7 @@ Callback is a piece of executable code that is passed as an
|
||||
argument to other code, which is expected to call back (execute) the argument
|
||||
at some convenient time.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -141,6 +141,9 @@ king.makeRequest(new Request(RequestType.TORTURE_PRISONER, "torture prisoner"));
|
||||
king.makeRequest(new Request(RequestType.COLLECT_TAX, "collect tax")); // Orc soldier handling request "collect tax"
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use Chain of Responsibility when
|
||||
|
||||
|
BIN
chain/etc/chain.urm.png
Normal file
After Width: | Height: | Size: 59 KiB |
@ -165,6 +165,8 @@ How does the above pattern prevent failures? Let's understand via this finite st
|
||||
- If the number of failures cross a certain threshold, we move to the **open** state, which acts just like an open circuit and prevents remote service calls from being made, thus saving resources. (Here, we return the response called ```stale response from API```)
|
||||
- Once we exceed the retry timeout period, we move to the **half-open** state and make another call to the remote service again to check if the service is working so that we can serve fresh content. A *failure* sets it back to **open** state and another attempt is made after retry timeout period, while a *success* sets it to **closed** state so that everything starts working normally again.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Circuit Breaker pattern when
|
||||
|
BIN
circuit-breaker/etc/circuit-breaker.urm.png
Normal file
After Width: | Height: | Size: 44 KiB |
@ -14,6 +14,7 @@ tags:
|
||||
Collection Pipeline introduces Function Composition and Collection Pipeline, two functional-style patterns that you can combine to iterate collections in your code.
|
||||
In functional programming, it's common to sequence complex operations through a series of smaller modular functions or operations. The series is called a composition of functions, or a function composition. When a collection of data flows through a function composition, it becomes a collection pipeline. Function Composition and Collection Pipeline are two design patterns frequently used in functional-style programming.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -18,6 +18,8 @@ The functional pattern representing a style of organizing libraries centered aro
|
||||
Putting it simply, there is some type T, some functions for constructing "primitive" values of type T,
|
||||
and some "combinators" which can combine values of type T in various ways to build up more complex values of type T.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the combinator pattern when:
|
||||
|
BIN
combinator/etc/combinator.urm.png
Normal file
After Width: | Height: | Size: 22 KiB |
@ -19,6 +19,7 @@ Encapsulate a request as an object, thereby letting you
|
||||
parameterize clients with different requests, queue or log requests, and
|
||||
support undoable operations.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,9 @@ tags:
|
||||
|
||||
> Used to handle all problems that can be encountered when doing distributed transactions.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
This pattern can be used when we need to make commits into 2 (or more) databases to complete transaction, which cannot be done atomically and can thereby create problems.
|
||||
|
||||
|
BIN
commander/etc/commander.urm.png
Normal file
After Width: | Height: | Size: 315 KiB |
@ -154,6 +154,9 @@ var elfMessage = new Messenger().messageFromElves();
|
||||
elfMessage.print(); // Much wind pours from your mouth.
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Composite pattern when
|
||||
|
||||
|
BIN
composite/etc/composite.urm.png
Normal file
After Width: | Height: | Size: 35 KiB |
@ -15,8 +15,6 @@ conversion between corresponding types, allowing a clean implementation in which
|
||||
need to be aware of each other. Moreover, the Converter Pattern introduces bidirectional collection
|
||||
mapping, reducing a boilerplate code to minimum.
|
||||
|
||||

|
||||
|
||||
## Explanation
|
||||
|
||||
Real world example
|
||||
@ -82,6 +80,9 @@ UserDto dtoUser = new UserDto("John", "Doe", true, "whatever[at]wherever.com");
|
||||
User user = userConverter.convertFromDto(dtoUser);
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Converter Pattern in the following situations:
|
||||
|
||||
|
@ -12,6 +12,7 @@ tags:
|
||||
## Intent
|
||||
CQRS Command Query Responsibility Segregation - Separate the query side from the command side.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,7 @@ tags:
|
||||
Object provides an abstract interface to some type of database or
|
||||
other persistence mechanism.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -16,6 +16,7 @@ Allows send of messages/events between components of an application
|
||||
without them needing to know about each other. They only need to know
|
||||
about the type of the message/event being sent.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -15,6 +15,8 @@ Accelerate memory access by arranging data to take advantage of CPU caching.
|
||||
|
||||
Modern CPUs have caches to speed up memory access. These can access memory adjacent to recently accessed memory much quicker. Take advantage of that to improve performance by increasing data locality keeping data in contiguous memory in the order that you process it.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
||||
|
BIN
data-locality/etc/data-locality.urm.png
Normal file
After Width: | Height: | Size: 66 KiB |
@ -12,6 +12,7 @@ tags:
|
||||
## Intent
|
||||
A layer of mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -15,6 +15,7 @@ tags:
|
||||
Pass data with multiple attributes in one shot from client to server,
|
||||
to avoid multiple calls to remote server.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -109,6 +109,9 @@ clubbedTroll.attack(); // The troll tries to grab you! The troll swings at you w
|
||||
clubbedTroll.fleeBattle(); // The troll shrieks in horror and runs away!
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use Decorator
|
||||
|
||||
|
BIN
decorator/etc/decorator.urm.png
Normal file
After Width: | Height: | Size: 23 KiB |
@ -16,6 +16,7 @@ Proxy Pattern
|
||||
It is a technique where an object expresses certain behavior to the outside but in
|
||||
reality delegates responsibility for implementing that behaviour to an associated object.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,6 +17,7 @@ pattern separates the creation of a client's dependencies from its own
|
||||
behavior, which allows program designs to be loosely coupled and to follow the
|
||||
inversion of control and single responsibility principles.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -14,6 +14,7 @@ tags:
|
||||
To avoid expensive re-acquisition of resources. The resources retain their identity, are kept in some
|
||||
fast-access storage, and are re-used to avoid having to acquire them again.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -12,6 +12,9 @@ tags:
|
||||
## Intent
|
||||
Double buffering is a term used to describe a device that has two buffers. The usage of multiple buffers increases the overall throughput of a device and helps prevents bottlenecks. This example shows using double buffer pattern on graphics. It is used to show one image or frame while a separate frame is being buffered to be shown next. This method makes animations and games look more realistic than the same done in a single buffer mode.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
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:
|
||||
|
||||
@ -25,4 +28,4 @@ This pattern is one of those ones where you’ll know when you need it. If you h
|
||||
|
||||
## Credits
|
||||
|
||||
* [Game Programming Patterns - Double Buffer]([http://gameprogrammingpatterns.com/double-buffer.html](http://gameprogrammingpatterns.com/double-buffer.html))
|
||||
* [Game Programming Patterns - Double Buffer]([http://gameprogrammingpatterns.com/double-buffer.html](http://gameprogrammingpatterns.com/double-buffer.html))
|
||||
|
BIN
double-buffer/etc/double-buffer.urm.png
Normal file
After Width: | Height: | Size: 34 KiB |
@ -16,6 +16,7 @@ locking criterion (the "lock hint") without actually acquiring the lock. Only
|
||||
if the locking criterion check indicates that locking is required does the
|
||||
actual locking logic proceed.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -14,6 +14,7 @@ tags:
|
||||
Double Dispatch pattern is a way to create maintainable dynamic
|
||||
behavior based on receiver and parameter types.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,7 +17,8 @@ the best parameters.
|
||||
|
||||
Aggregator allows you to merge messages based on defined criteria and parameters. It gathers original messages,
|
||||
applies aggregation strategy and upon fulfilling given criteria, releasing merged messages.
|
||||
|
||||
|
||||
## Diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
@ -30,4 +31,3 @@ Use the Aggregator pattern when
|
||||
|
||||
* [Gregor Hohpe, Bobby Woolf - Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/patterns/messaging/Aggregator.html)
|
||||
* [Apache Camel - Documentation](http://camel.apache.org/aggregator2.html)
|
||||
|
||||
|
@ -14,6 +14,7 @@ tags:
|
||||
When two applications communicate using a messaging system they do it by using logical addresses
|
||||
of the system, so called Message Channels.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,7 @@ tags:
|
||||
## Intent
|
||||
Broadcast messages from sender to all the interested receivers.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,6 +17,7 @@ service/sold goods, price etc.). Such bundled messages may not be accepted by ot
|
||||
pattern comes in handy. It will take the whole document, split it based on given criteria and send individual
|
||||
items to the endpoint.
|
||||
|
||||
## Diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
@ -29,4 +30,3 @@ Use the Splitter pattern when
|
||||
|
||||
* [Gregor Hohpe, Bobby Woolf - Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/patterns/messaging/Sequencer.html)
|
||||
* [Apache Camel - Documentation](http://camel.apache.org/splitter.html)
|
||||
|
||||
|
@ -15,6 +15,7 @@ In most integration cases there is a need to monitor the messages flowing throug
|
||||
by intercepting the message and redirecting it to a different location like console, filesystem or the database.
|
||||
It is important that such functionality should not modify the original message and influence the processing path.
|
||||
|
||||
## Diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -18,6 +18,7 @@ requires a separate subscription. An Event Aggregator acts as a single source
|
||||
of events for many objects. It registers for all the events of the many objects
|
||||
allowing clients to register with just the aggregator.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -19,6 +19,7 @@ of the complex issues inherent in multithreaded design. Using a class that suppo
|
||||
3. Wait for resources to become available without stopping ("hanging") your application.
|
||||
4. Communicate with pending asynchronous operations using the familiar events-and-delegates model.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,7 @@ tags:
|
||||
## Intent
|
||||
Send and notify state changes of your objects to other applications using an Event-driven Architecture.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,6 +17,7 @@ It puts all the requests in a queue and process them asynchronously.
|
||||
Gives the resource for the event when it is the next in the queue and in same time
|
||||
removes it from the queue.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,7 @@ tags:
|
||||
## Intent
|
||||
Instead of storing just the current state of the data in a domain, use an append-only store to record the full series of actions taken on that data. The store acts as the system of record and can be used to materialize the domain objects. This can simplify tasks in complex domains, by avoiding the need to synchronize the data model and the business domain, while improving performance, scalability, and responsiveness. It can also provide consistency for transactional data, and maintain full audit trails and history that can enable compensating actions.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -16,6 +16,7 @@ should always be executed before and after the business method. A good example
|
||||
of this is resource allocation and deallocation leaving the user to specify
|
||||
only what to do with the resource.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,7 @@ tags:
|
||||
Anticipate that an object’s interface needs to be extended in the future. Additional
|
||||
interfaces are defined by extension objects.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -197,6 +197,9 @@ facade.endDay();
|
||||
// Dwarven tunnel digger goes to sleep.
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Facade pattern when
|
||||
|
||||
|
BIN
facade/etc/facade.urm.png
Normal file
After Width: | Height: | Size: 61 KiB |
@ -13,6 +13,7 @@ tags:
|
||||
## Intent
|
||||
Define a factory of immutable content with separated builder and factory interfaces.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -62,6 +62,9 @@ blacksmith.manufactureWeapon(WeaponType.AXE);
|
||||
// Elvish weapons are created
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Factory Method pattern when
|
||||
|
||||
|
BIN
factory-method/etc/factory-method.urm.png
Normal file
After Width: | Height: | Size: 52 KiB |
@ -18,6 +18,7 @@ and rolled out. Allowing switching back to the older feature quickly if needed.
|
||||
can easily introduce code complexity. There is also cause for concern that the old feature that the toggle is eventually
|
||||
going to phase out is never removed, causing redundant code smells and increased maintainability.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
@ -29,4 +30,4 @@ Use the Feature Toggle pattern when
|
||||
|
||||
## Credits
|
||||
|
||||
* [Martin Fowler 29 October 2010 (2010-10-29).](http://martinfowler.com/bliki/FeatureToggle.html)
|
||||
* [Martin Fowler 29 October 2010 (2010-10-29).](http://martinfowler.com/bliki/FeatureToggle.html)
|
||||
|
@ -21,6 +21,7 @@ A fluent interface can be implemented using any of
|
||||
* Static Factory Methods and Imports
|
||||
* Named parameters - can be simulated in Java using static factory methods.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -15,6 +15,7 @@ user interacts with a view, the view propagates an action through a central
|
||||
dispatcher, to the various stores that hold the application's data and business
|
||||
logic, which updates all of the views that are affected.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -110,6 +110,9 @@ factory.createPotion(PotionType.HOLY_WATER).drink(); // You feel blessed. (Potio
|
||||
factory.createPotion(PotionType.HEALING).drink(); // You feel healed. (Potion=648129364)
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
The Flyweight pattern's effectiveness depends heavily on how
|
||||
and where it's used. Apply the Flyweight pattern when all of the following are
|
||||
|
BIN
flyweight/etc/flyweight.urm.png
Normal file
After Width: | Height: | Size: 54 KiB |
@ -14,6 +14,7 @@ Introduce a common handler for all requests for a web site. This
|
||||
way we can encapsulate common functionality such as security,
|
||||
internationalization, routing and logging in a single place.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -34,7 +34,9 @@ The variable-step game loop chooses a time step to advance based on how much rea
|
||||
|
||||
For fixed-step game loop, a certain amount of real time has elapsed since the last turn of the game loop. This is how much game time need to be simulated for the game’s “now” to catch up with the player’s.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Credits
|
||||
|
||||
* [Game Programming Patterns - Game Loop](http://gameprogrammingpatterns.com/game-loop.html)
|
||||
* [Game Programming Patterns - Game Loop](http://gameprogrammingpatterns.com/game-loop.html)
|
||||
|
BIN
game-loop/etc/game-loop.urm.png
Normal file
After Width: | Height: | Size: 56 KiB |
@ -12,6 +12,7 @@ tags:
|
||||
## Intent
|
||||
Use Guarded suspension pattern to handle a situation when you want to execute a method on object which is not in a proper state.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -14,6 +14,7 @@ The Half-Sync/Half-Async pattern decouples synchronous I/O from
|
||||
asynchronous I/O in a system to simplify concurrent programming effort without
|
||||
degrading execution efficiency.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -18,6 +18,7 @@ tags:
|
||||
## Intent
|
||||
Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -12,11 +12,10 @@ tags:
|
||||
## Intent
|
||||
Provide pluggable filters to conduct necessary pre-processing and
|
||||
post-processing to requests from a client to a target
|
||||
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
|
||||
|
||||
## Applicability
|
||||
Use the Intercepting Filter pattern when
|
||||
|
||||
|
@ -15,6 +15,7 @@ Given a language, define a representation for its grammar along
|
||||
with an interpreter that uses the representation to interpret sentences in the
|
||||
language.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,6 +17,7 @@ Cursor
|
||||
Provide a way to access the elements of an aggregate object
|
||||
sequentially without exposing its underlying representation.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -15,15 +15,6 @@ tags:
|
||||
Layers is an architectural pattern where software responsibilities are
|
||||
divided among the different layers of the application.
|
||||
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Layers architecture when
|
||||
|
||||
* you want clearly divide software responsibilities into different parts of the program
|
||||
* you want to prevent a change from propagating throughout the application
|
||||
* you want to make your application more maintainable and testable
|
||||
|
||||
## Explanation
|
||||
|
||||
Real world example
|
||||
@ -102,6 +93,16 @@ public class CakeViewImpl implements View {
|
||||
}
|
||||
```
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Layers architecture when
|
||||
|
||||
* you want clearly divide software responsibilities into different parts of the program
|
||||
* you want to prevent a change from propagating throughout the application
|
||||
* you want to make your application more maintainable and testable
|
||||
|
||||
## Credits
|
||||
|
||||
* [Pattern Oriented Software Architecture Vol I-V](http://www.amazon.com/Pattern-Oriented-Software-Architecture-Volume-Patterns/dp/0471958697)
|
||||
|
@ -17,6 +17,7 @@ initialization of an object until the point at which it is needed. It can
|
||||
contribute to efficiency in the program's operation if properly and
|
||||
appropriately used.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -12,6 +12,9 @@ tags:
|
||||
## Intent
|
||||
Leader Election pattern is commonly used in cloud system design. It can help to ensure that task instances selec the leader instance correctly and do not conflict with each other, cause contention for shared resources, or inadvertently interfere with the work that other task instances are performing.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
Use this pattern when
|
||||
|
||||
|
BIN
leader-election/etc/leader-election.urm.png
Normal file
After Width: | Height: | Size: 170 KiB |
@ -12,6 +12,7 @@ tags:
|
||||
## Intent
|
||||
Using empty interfaces as markers to distinguish special treated objects.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,6 +17,9 @@ tags:
|
||||
|
||||
> Used for centralised parallel processing.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
This pattern can be used when data can be divided into multiple parts, all of which need to go through the same computation to give a result, which need to be aggregated to get the final result.
|
||||
|
||||
|
BIN
master-worker-pattern/etc/master-worker-pattern.urm.png
Normal file
After Width: | Height: | Size: 101 KiB |
@ -15,6 +15,7 @@ Define an object that encapsulates how a set of objects interact.
|
||||
Mediator promotes loose coupling by keeping objects from referring to each
|
||||
other explicitly, and it lets you vary their interaction independently.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -17,6 +17,7 @@ Token
|
||||
Without violating encapsulation, capture and externalize an
|
||||
object's internal state so that the object can be restored to this state later.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -15,6 +15,7 @@ the model, the view and the controller. Let the model manage the data, the view
|
||||
display the data and the controller mediate updating the data and redrawing the
|
||||
display.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -13,6 +13,7 @@ tags:
|
||||
Apply a "Separation of Concerns" principle in a way that allows
|
||||
developers to build and test user interfaces.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -12,6 +12,7 @@ tags:
|
||||
## Intent
|
||||
Module pattern is used to implement the concept of software modules, defined by modular programming, in a programming language with incomplete direct support for the concept.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -19,6 +19,7 @@ operations:
|
||||
bind - that takes monadic object and a function from plain object to monadic value and returns monadic value
|
||||
return - that takes plain type object and returns this object wrapped in a monadic value.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
@ -32,4 +33,4 @@ Use the Monad in any of the following situations
|
||||
|
||||
* [Design Pattern Reloaded by Remi Forax](https://youtu.be/-k2X7guaArU)
|
||||
* [Brian Beckman: Don't fear the Monad](https://channel9.msdn.com/Shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads)
|
||||
* [Monad on Wikipedia](https://en.wikipedia.org/wiki/Monad_(functional_programming))
|
||||
* [Monad on Wikipedia](https://en.wikipedia.org/wiki/Monad_(functional_programming))
|
||||
|
@ -15,6 +15,7 @@ Borg
|
||||
## Intent
|
||||
Enforces a behaviour like sharing the same state amongst all instances.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -16,6 +16,7 @@ Registry
|
||||
Ensure a class only has limited number of instances, and provide a
|
||||
global point of access to them.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -14,7 +14,7 @@ tags:
|
||||
Provide a template to suppress any exceptions that either are declared but cannot occur or should only be logged;
|
||||
while executing some business logic. The template removes the need to write repeated `try-catch` blocks.
|
||||
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -16,6 +16,7 @@ Binary Semaphore
|
||||
## Intent
|
||||
Create a lock which only allows a single thread to access a resource at any one instant.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -14,6 +14,7 @@ The Naked Objects architectural pattern is well suited for rapid
|
||||
prototyping. Using the pattern, you only need to write the domain objects,
|
||||
everything else is autogenerated by the framework.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|
@ -19,6 +19,7 @@ implements the expected interface, but whose method body is empty. The
|
||||
advantage of this approach over a working default implementation is that a Null
|
||||
Object is very predictable and has no side effects: it does nothing.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
|