Layered Architecture
Layered Architecture
A layered software architecture organizes components into horizontal layers with clear interfaces. This promotes
modularity, scalability, and maintainability by separating concerns and enforcing dependencies.
Architecture Description
Layers Separation of Concerns Responsibilities
Typical layers include Components in each layer only Each layer is responsible for a
presentation, business, handle logic for that layer, specific set of tasks, like
persistence, and database. making the architecture modular. displaying data or executing
business rules.
Closed Layers
1 Layer Isolation
Changes in one layer don't impact other layers, enabling flexibility and easier refactoring.
2 Request Flow
Requests must flow through each layer sequentially, preventing direct access between layers.
3 Governance
Closed layers help control and restrict access to shared services and resources.
Open Layers
Exceptions
Open layers allow requests to bypass certain layers when needed, like accessing shared services.
Flexibility
Open layers provide more architectural flexibility to accommodate evolving requirements.
Documentation
Clearly documenting open and closed layers is crucial for understanding the architecture.
Pattern Analysis
The core processing engine that The user-facing interface that The storage system that securely
powers Gmail's functionality. communicates with users in their houses millions of user email
preferred languages. messages.
Layered Architecture in Action
User Request
Presentation Layer
Handles the UI and forwards the request.
Business Layer
Aggregates customer and order data.
Layered Architecture in Action (cont.)
Persistence Layer
Retrieves data from the database using SQL.
Database Layer
Stores and returns the requested customer data.
Response
Data flows back up the layers to the user.
Amaze: Seamless Project
Management Across
Devices
Amaze, a project
management software
company, aims to provide a
single application that works
seamlessly across all popular
devices, minimizing software
maintenance costs.
Business Problem: -
Amaze, a project management software company, faces the challenge of ensuring their
product works seamlessly across various devices
- The goal is to have a single software application that supports all popular devices
without exceptions
- Minimizing software maintenance costs is a priority
Solution Approach: -
Layered Architecture:
• Amaze adopts a layered architecture to address the problem
Amaze Basic Rules Layer:
• Contains critical rules governing the entire application's behavior
• Examples include enforcing constraints like "Project schedules require a defined project scope
• Houses intelligence derived from decades of project experience
Application Core Layer:
• Represents the most significant part of the application code
• Integrates business logic and core functionality
• Orchestrates interactions between different layers.
Database Layer:
• Manages data storage and retrieval
• Ensures data consistency and integrity
Conclusion
The layered architecture pattern is a well-established design that separates
concerns and enables modular development. While it has some limitations, it
remains a popular choice for many business applications.