Reference articles on history, science, culture and more
Encyclopedia

Service layer pattern

Layered architectural pattern

Service layer is an architectural pattern, applied within the service-orientation design paradigm, which aims to organize the services, within a service inventory, into a set of logical layers. Services that are categorized into a particular layer share functionality. This helps to reduce the conceptual overhead related to managing the service inventory, as the services belonging to the same layer address a smaller set of activities.

01Rationale

Grouping services into functional layers reduces the impact of change. Most changes affect only the layer in which they're made, with few side-effects that impact other layers. This fundamentally simplifies service maintenance.

The service reusability principle dictates that services should be designed to maximize reuse. Similarly, the service composability principle advocates designing services so that they can be composed in various ways. Both principles require that a service contain only a specific type of logic e.g., either reusable or process-specific logic. Restricting each layer to a particular functionality, simplifies the design of the service.

Diagram AIn the absence of any layers, services contain a mixture of different types of logic. This makes it difficult to manage these services.
Diagram AIn the absence of any layers, services contain a mixture of different types of logic. This makes it difficult to manage these services.

02Usage

Applying this pattern requires creating a service inventory blueprint, a list of services with associated functionality. Next, group the services into layers according to function. Adopting a common layering strategy across the enterprise facilitates reuse in other applications, because developers don't have as much to learn (or invent) when they join a project. One common layering uses task, entity and utility.

An alternative layering from Bieberstein et al., involves five layers, namely enterprise, process, service, component and object.

The service layer pattern invokes a specific service architecture.

The top-down service delivery approach facilitates the use of this pattern.

Diagram BA service inventory divided into layers where each layer contains the same type of logic.
Diagram BA service inventory divided into layers where each layer contains the same type of logic.
Watch videos about Service layer patternExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Service layer pattern, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.