view as markdownreport a mistake

Deconstructing patterns

type: source-page
updated: 2026-07-02
status: imported
namespace: software-architecture-metapatterns
Imported source page from Denys Poltorak's Architectural Metapatterns wiki. Source path: Analytics/The heart of software architecture/Deconstructing patterns.md.

Imagine a dungeon with dragons. It is made of halls connected by tunnels. Each hall is cohesive. Tunnels are narrow interfaces that decouple them. A hall is amorphous – it can have any shape but it cannot open to another hall except through a tunnel – such are the rules of the game. The tunnels both restrict the freedom of the halls and interconnect them.

SOLID principles

If cohesion and decoupling dictate software architecture, they should surface in its principles. Let’s take a look at SOLID:

Please beware that each of those principles in and of themselves invokes decoupling which is not free – your software may end up having too many moving parts and strict rules to remain easy to read and support.

When we choose between cohesion and decoupling, we choose between a single component and a pair of components connected through a constraint rule. The more decoupling, the more components and rules we have to handle. Sooner, rather than later, the number of individual components and rules will overwhelm any developer.

Gang of Four patterns

Let’s now discuss something more practical, namely the \[GoF\] patterns which seem to be ingenious, yet hacky, ways for rearranging the roles in your code. They override ordinary OOP rules, which is useful when you need extra flexibility. For example, the creational patterns interfere with the normally cohesive select type – create – initialize – use sequence of operating an object.

Some patterns provide a basic decoupling:

Others break the functionality or data of a class into two or more parts, juggling them at runtime:

On the other hand, several patterns gather separate components together:

The remaining patterns pick an aspect or two of an object’s behavior and move them elsewhere:

As we see, every \[GoF\] pattern boils down to binding (making cohesive) and/or separating (decoupling) some kind of functionality or responsibilities.

Architectural metapatterns

Finally, let’s close the book by iterating over the metapatterns and looking into their roots through the lens of unification and separation.

Diagrams of Monolith, Shards, Layers, Services, and Pipeline, with cohesive and decoupled components highlighted.

Basic architectures:

Diagrams of Services with a middleware, Services with a shared repository, Services with a proxy, Services with an orchestrator, and Sandwich, with cohesive and decoupled components highlighted.

Grouping related functionality:

Diagrams of Layered Services, Services with Polyglot Persistence, Backends for Frontends, Service-Oriented Architecture, and Top-Down Hierarchy, with cohesive and decoupled components highlighted.

Decoupled topologies:

Diagrams of Plugins, Hexagonal Architecture, Microkernel, and Mesh, with cohesive and decoupled components highlighted.

Component implementation:

External links