A style is a standard framework for how a system is put together: it says what counts as the major parts and how to connect them, but does not describe any particular system. Choosing a style is one of the first architectural decisions and the hardest one to change later: a monolith does not turn into microservices with a single refactoring.
What a style specifies
By the definition from Roy Fielding’s dissertation, a style is a coordinated set of architectural constraints that determines the roles of elements and the relationships allowed between them. For example:
- components — major roles: a client, a server, a data store, a service, a gateway;
- connectors — ways of communicating: a function call, an HTTP request, a message queue, an event stream;
- constraints — rules that any system in the style must obey: “a layer talks only to its neighbours”, “services do not read each other’s databases directly”.
How a style differs from a pattern
A style describes the system as a whole, while a design pattern is a repeatable solution to a local problem within modules and classes. Styles and patterns work together: in a system built in the microservices style, an individual service may apply the transactional outbox pattern, while a monolith has a layered structure inside.
| Criterion | Style | Design pattern |
|---|---|---|
| Scale | the whole system and its major parts | a module, classes, a single task |
| What it defines | a framework: which parts exist and which links are allowed | a ready-made solution to a recurring problem |
| Example | monolith, microservices, event-driven architecture | transactional outbox, repository |
Examples of styles
| Style | Idea | When it is used |
|---|---|---|
| Monolith | the whole system is a single deployable unit | a small team, early stages of a product |
| Layered | layers for presentation, logic and data access | typical enterprise applications |
| Hexagonal | the core with the logic is separated from the outside world by ports and adapters | complex business logic, testability matters |
| Microservices | many small services connected over the network | large teams, independent deployments |
| Event-driven | components exchange events through a broker | event flows, loose coupling between parts |
Where the term comes from
One of the first definitions of a style was given by Dewayne Perry and Alexander Wolf in a 1992 paper. In 2000, Roy Fielding showed in his dissertation that REST is assembled from the constraints of several well-known styles — that is how the style became a working concept for web development as well.
Sources
the term is written from these pages- Roy T. Fielding — Architectural Styles and the Design of Network-based Software Architectures (2000), раздел 1.5ics.uci.edu/~fielding/pubs/dissertation/software_arch.htm(opens in a new tab)
- D. E. Perry, A. L. Wolf — Foundations for the Study of Software Architecture (1992), по списку литературы диссертацииics.uci.edu/~fielding/pubs/dissertation/references.htm(opens in a new tab)
- Microsoft Azure — Architecture guide: Architecture styleslearn.microsoft.com/en-us/azure/architecture/guide/architecture-styles/(opens in a new tab)
Verified 8 Nov