Horizontal Slice
Updated 2026-08-22
Summary
A horizontal slice divides a system by functional layer, so each layer holds one kind of responsibility and depends on the ones beneath it.
Definition
A horizontal slice divides a system by functional layer, such as presentation, business logic, and data access, in contrast to a vertical slice organized by feature. The core proposition is that separating concerns by layer lets each part be understood, tested, and replaced without knowledge of the others, which is what makes a complex system tractable. The key qualification is that layers must have a defined dependency direction: allowing a lower layer to reference a higher one destroys the isolation the division was meant to create.
Introduction
How to use
- Layer identification: name the natural functional layers that make up your system. - Interface contract: define exactly what each layer exposes to the one above it. - Dependency direction: enforce that upper layers depend on lower ones and never in the reverse direction.
Mechanism
Grouping by responsibility means each layer only has to satisfy its own contract, so a change inside one layer does not propagate through the others. The complexity of the whole is thereby reduced to a set of thin, independently verifiable parts. Interfaces carry the assumptions between layers, which is why the dependency direction has to be fixed explicitly rather than left to convenience.
Practice
In progress 0/1Practice this model in one real situation:
Cases
- Classic three-tier architectures separate the user interface, the business logic, and database access.
- The OSI network model divides communication into seven functional layers with defined interfaces.
Common pitfalls
- Layering so finely that call chains become long and performance suffers for no design benefit.
- Letting dependencies run in both directions, which removes the isolation and leaves the layers coupled in practice.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E4%BA%BA%E6%9C%88%E7%A5%9E%E8%AF%9Dverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS