Layers Pattern

The layers pattern is one of the most used (and abused) architecture patterns. Most software systems have multiple contributors. Partitioning code into distinct and independent layers organized around a specific set of related concerns enables developers to work together better. Layers promote decreased coupling between the layers and higher cohesion within, which promotes maintainability. Use layers any time you need to change code modules independently of one another.

Category

Module

Elements

Layer—group of functionally cohesive modules.

Relations

Allowed to use—indicates which layers may use modules within another layer.

Rules for Use

Every module must be allocated to one and only one layer.

Layers above are allowed to use layers ...

Get Design It! now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.