Software Design and Architectural Patterns

Decorator

Structural Pattern

A decorator allows to add behavior to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.

Default Visitor

Behavioral Pattern

This pattern adds another level of inheritance to Visitor, providing a default implementation that takes advantage of the inheritance relationships in a polymorphic hierarchy of elements.

Dependency Injection

Creational Pattern

Instead of creating dependent objects, the objects are passed to the client either by constructor injection, setter injection or interface injection. The client does not need to know the implementation details of the used objects, only its interfaces.

Double-Checked Locking

Synchronization Pattern

A concurrency pattern which reduces the overhead of acquiring a lock. First, the locking condition is tested without acquiring the lock. Only if this check indicates that locking is required the actual locking mechanism and the synchronized logic is executed.

Encapsulate Field

Refactoring

Refactor a private field so that it can only be accessed using getter or setter methods. The advantage is that the accessors can be extended with additional logic without recompiling the client.

Event Sourcing

Architectural Pattern

Use an append-only store to record the full series of events that describe actions taken on data in a domain, rather than storing just the current state, so that the store can be used to materialize the domain objects.

Extension Interface

Configuration Pattern

The Extension Interface design pattern allows multiple interfaces to be exported by a component, to prevent bloating of interfaces and breaking of client code when developers extend or modify the functionality of the component.

Extension Object

Structural Pattern

Attach additional methods to a class. Whereas Decorator requires that the core class's interface remain fixed as successive "wrappers" are applied, Extension Objects allow the class's interface to grow incrementally and dynamically.

Extract Class

Refactoring

Create a new class and move the relevant fields and methods from the old class into the new class.

Extract Method

Refactoring

Extract a code fragment into a new method whose name explains its purpose. The refactoring is a way remove code comments and create small methods.

Extrinsic Visitor

Behavioral Pattern

Trade the performance overhead of a small number of run-time type tests for reduced complexity and coupling in the visitor and element classes by testing the feasibility of a visit operation before performing it.

Facade

Structural Pattern

The facade pattern is used to define a simplified interface to a more complex subsystem.

Factory Method

Creational Pattern

An object with methods to create objects without specifying the exact class that will be created. Depending on the concrete factory implementation objects with different classes are created.

Flyweight

Structural Pattern

The flyweight pattern is used to reduce the memory and resource usage for complex models containing many hundreds, thousands or hundreds of thousands of similar objects.

Forwarder-Receiver

Communication Pattern

The Forwarder-Receiver design pattern provides transparent inter-process communication for software systems with a peer-to-peer interaction model. It introduces forwarders and receivers to decouple peers from the underlying communication mechanism.

Half-Sync/Half-Async

Concurrency Pattern

The Half-Sync/Half-Async architectural pattern decouples asynchronous and synchronous service processing in concurrent systems, to simplify programming without unduly reducing performance. The pattern introduces two intercommunicating layers, one for asynchronous and one for synchronous service processing.

Interceptor

Architectural Pattern

The intercepting filter design pattern is used when we want to do some pre-processing / post-processing with request or response of the application. Filters are defined and applied on the request before passing the request to actual target application.

Interpreter

Behavioral Pattern

The interpreter pattern is used to define the grammar for instructions that form part of a language or notation, whilst allowing the grammar to be easily extended.

Iterator

Behavioral Pattern

An iterator provides the interface to traverse a container's elements. The implementation is hidden so that the client does not need to understand the traversing algorithm.

Layers

Architectural Pattern

The Layered architectural pattern helps to structure applications that can be decomposed into groups of subtasks in which each group of subtasks Is at a particular level of abstraction.