SOLID & Design Patterns Interview Question #101

What is the Layered Architecture pattern?

Architectural Patterns, Application Boundaries & Distributed Design Patterns Senior Advanced

Quick Interview Answer

Layered Architecture organizes an application into logical layers such as presentation, application/business logic, and data access. Each layer has a defined responsibility and normally communicates with adjacent or permitted layers.

Detailed Explanation

Layered Architecture organizes an application into logical layers such as presentation, application/business logic, and data access. Each layer has a defined responsibility and normally communicates with adjacent or permitted layers.

The pattern is easy to understand and works well for many business applications. Problems arise when layers become tightly coupled, business logic leaks into controllers or repositories, or every request is forced through unnecessary pass-through layers.

Code Example

Presentation
    |
Application
    |
Domain / Business
    |
Infrastructure / Data