Contrasting architecture patterns with design patterns

How architecture and design patterns can add clarity and understanding to your project.

By Neal Ford
September 30, 2015
Three elevations of a ceiling panel Three elevations of a ceiling panel (source: Ashley Van Haeften on Flickr)


Components rather than classes


Learn faster. Dig deeper. See farther.


Learn more


Figure 1: Layered architecture with mixed closed and open layers
Figure 1: Layered architecture with mixed closed and open layers


Component types

Generally, design patterns utilize one type of entity (the class from object oriented programming) and illustrate the relationship between the classes within a solution.

Architecture patterns utilize a variety of component types, each typically composed of successively smaller modules. Each component has a responsibility within the architecture. For example, consider the diagram in Figure 2 of the Micro-kernel architecture pattern:

Figure 2: Component Types in micro-kernel architecture
Figure 2: Component Types in micro-kernel architecture

Micro-kernel is a simple architecture with just two component types, core and plug-in. Other architecture patterns have many more moving parts; consider the space-based architecture pattern shown in Figure 3.

Figure 3: Component types in space-based architecture
Figure 3: Component types in space-based architecture

The space-based architecture pattern includes 5 distinct components types:

processing unit where work is performed
messaging grid manages input request and session
data grid manages data replication between processing units
processing grid manages distributed request processing
deployment manager manages dynamic processing unit deployment

Table 1: Components types in a space-based architecture.

Space-based architectures may have hundreds or thousands of processing units (indicated by the ellipsis in the diagram) and one each of the other component types. Each component has distinct responsibilities, making it important to delineate each separately.

Variants and hybrids

Another common occurrence in architecture patterns are variants and hybrids. The open layer shown in Figure 1 is a good example of a traditional layered architecture variant. Similarly, event driven architectures typically have two common variants, the mediator and broker patterns.

A good example of a hybrid architecture is the service-based architecture, a hybrid of the highly partitioned Service Oriented Architecture pattern and the bounded context of the micro-service pattern, as shown in Figure 4.

Figure 4: A service-based architecture is a hybrid between SOA and microservices.

It is also common to embed architectural styles within others. For example, in the service-based architecture in Figure 4, one of the services could be implemented using a micro-kernel architecture while another might use a layered approach.

Hybrids and variants are as common in architecture patterns as they are rare in design patterns. Because architecture represents practical building blocks, pragmatic variations abound.

Scaffolding versus design

Ultimately, the differences between design and architecture patterns reflect their different uses. Architecture represents scaffolding, the frameworks that everything else sits upon. Design patterns represent a way to structure classes to solve common problems. While both are designed to add clarity and understanding, they operate at different levels of abstraction.

Architects must have both kinds of patterns at their disposal: design patterns to build the best internal structure, and architectural patterns to help define and maintain the underlying scaffolding of the application.

Post topics: Software Architecture, Software Engineering

Get the O’Reilly Programming Newsletter

Get the O’Reilly Programming Newsletter