Software Architecture: 3-Layer Model / 3-Tier
This article is a term explanation for the 3-layer model (3-tier) – including exam questions, key points and tags.
In a Nutshell
The 3-layer model logically separates software into presentation, business logic and data access – for clear responsibilities, maintainability and testability.
Compact Technical Description
The three layers:
- Presentation (UI)
- Business Logic (Services/Use Cases)
- Persistence (Repository/ORM/DB)
Communication typically occurs from top to bottom. Each layer only knows the one directly below it. This makes systems loosely coupled.
Exam-Relevant Key Points
- Separation of presentation, logic, data access
- Clear responsibilities
- Better testability/maintainability
- Standard in Java/.NET/web projects (IHK-relevant)
- Components are interchangeable (UI changes)
- Layers are security barriers
- Modularization reduces follow-up costs
- Architecture must be documented
Core Components
- Presentation layer
- Logic layer
- Data access layer
- Interfaces between layers
- Logging/error handling
- Unit tests in business layer
- DTOs
- Security layer
- Persistence (SQL/NoSQL)
Practical Example
UI (HTML/JS): Input
Business (Controller/Service): Validation/Processing
Persistence (ORM/MySQL): Storage
Advantages and Disadvantages
Advantages
- Structured, maintainable application
- Easy component replacement
- Good testability
Disadvantages
- Initial higher effort
- Overhead in very small projects
Typical Exam Questions (with Short Answers)
- What does the 3-layer model describe? Presentation, logic, data access.
- Which layer validates input? Business logic.
- What belongs to the data access layer? DB access, SQL/ORM, repositories.
Free Answer
For IHK projects, the model is ideal because it is easy to draw and justify. Important: no SQL in the controller and no database access from the UI.
Learning Strategy
- Draw the model for a system (shop/blog).
- Implement CRUD app strictly according to layers.
- Explain layers in project documentation.
- Implement separation technically through packages/namespaces.