Skip to main content
Abstract Document

Intent

The Abstract Document design pattern is a structural design pattern that aims to provide a consistent way to handle hierarchical and tree-like data structures by defining a common interface for various document types. It separates the core document structure from specific data formats, enabling dynamic updates and simplified maintenance.


iluwatarAbout 4 minStructuralAbstractionExtensibilityDecoupling
Abstract Factory

Also known as

Kit

Intent

The Abstract Factory design pattern provides a way to create families of related objects without specifying their concrete classes. This allows for code that is independent of the specific classes of objects it uses, promoting flexibility and maintainability.


iluwatarAbout 3 minCreationalAbstractionDecouplingGang of Four
Acyclic Visitor

Intent

The Acyclic Visitor pattern decouples operations from an object hierarchy, allowing you to add new operations without modifying the object structure directly.

Explanation

Real world example

We have a hierarchy of modem classes. The modems in this hierarchy need to be visited by an external algorithm based
on filtering criteria (is it Unix or DOS compatible modem).


iluwatarAbout 2 minBehavioralDecouplingExtensibility
Aggregator Microservices

Intent

Streamline client's interactions with system's microservices by providing a single aggregation point that consolidates data and responses from multiple services. This simplifies the client's communication with the system, improving efficiency and reducing complexity.

Explanation


iluwatarAbout 2 minArchitecturalAPI designCloud distributedDecouplingMicroservices
Ambassador

Intent

Provide a helper service instance on a client and offload common functionality away from a shared resource.

Also known as

  • Sidecar

Explanation

Real world example

A remote service has many clients accessing a function it provides. The service is a legacy application and is
impossible to update. Large numbers of requests from users are causing connectivity issues. New rules for request
frequency should be implemented along with latency checks and client-side logging.


iluwatarAbout 4 minStructuralDecouplingCloud distributed
Anti-corruption layer

Also known as

  • ACL
  • Interface layer
  • Translation layer

Intent

Implement a façade or adapter layer between different subsystems that don't share the same semantics. It translates between different data formats and systems, ensuring that the integration between systems does not lead to corruption of business logic or data integrity.


iluwatarAbout 3 minIntegrationArchitectureDecouplingIsolation
API Gateway

Intent

The API Gateway design pattern aims to provide a unified interface to a set of microservices. It acts as a single entry point for clients, routing requests to the appropriate microservices and aggregating results, thereby simplifying the client-side code.

Also known as


iluwatarAbout 3 minArchitecturalAPI designCloud distributedDecouplingMicroservices
Balking

Intent

Balking Pattern is used to prevent an object from executing a certain code if it is in an incomplete or inappropriate state. If the state is not suitable for the action, the method call is ignored (or "balked").

Explanation

Real world example

There's a start-button in a washing machine to initiate the laundry washing. When the washing
machine is inactive the button works as expected, but if it's already washing the button does
nothing.


iluwatarAbout 3 minConcurrencyDecoupling
Bridge

Also known as

Handle/Body

Intent

Decouple an abstraction from its implementation so that the two can vary independently.

Explanation

Real-world example

Consider you have a weapon with different enchantments, and you are supposed to allow mixing different weapons with different enchantments. What would you do? Create multiple copies of each of the weapons for each of the enchantments or would you just create separate enchantment and set it for the weapon as needed? Bridge pattern allows you to do the second.


iluwatarAbout 3 minStructuralDecouplingExtensibilityGang of Four
Business Delegate

Intent

The Business Delegate pattern adds an abstraction layer between 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.


iluwatarAbout 2 minStructuralDecoupling