-
Notifications
You must be signed in to change notification settings - Fork 0
2 ‐ Architecture
Organizes an application into horizontal tiers, each with a defined responsibility and dependency direction.
Handles HTTP requests, validation, and response formatting.
Orchestrates business use cases and workflows.
Encapsulates core business rules, entities, value objects, and invariants.
Manages data storage and retrieval via repositories or DAOs.
Integrates with external systems (email, cache, logging).
Benefits:
- Clear separation of concerns makes onboarding and maintenance easier.
- Layers can be developed and tested independently.
- Encourages consistent organization across teams and services.
Is a design pattern that externalizes object creation, allowing components to declare dependencies rather than construct them.
Benefits:
- Decouples high-level modules from low-level implementations.
- Simplifies testing by swapping real dependencies with mocks or stubs.
- Centralizes configuration of shared resources (database connections, services).
Object-Relational Mapping (ORM) frameworks bridge the gap between in-memory object models and relational databases.
Benefits:
- Reduces boilerplate CRUD code.
- Enforces schema and model consistency.
- Integrates migrations for safe schema updates.
- Entity mapping with decorators or configuration files.
- Query builders and repositories for type-safe data access.
Relational databases store data in structured tables with defined schemas and relationships.
Benefits:
- Structured schema with data validation at the database level.
- Powerful querying with SQL, including joins and aggregations.
- Mature tooling for backup, replication, and monitoring.
Defines principles for building scalable and evolvable web APIs.
Benefits:
- Countless frameworks come with built-in support for REST.
- Easier Evolution and Versioning.
- Proven web security practices (HTTPS/TLS, OAuth, JWT)
Packages applications and their dependencies into isolated, lightweight units.
Benefits:
- Consistent environments across development, testing, and production.
- Faster startup and lower overhead compared to VMs.
- Simplified dependency and version management.
REQUEST RESPONSE
Host OS ↓ ↑
+-------------------------------------------+
| Container |
| ↓ ↑ |
| +-------------------------------------+ |
| | Presentation Layer (Controllers) | |
| +-------------------------------------+ |
| ↓ ↑ |
| +-------------------------------------+ |
| | Application Layer (Services) | |
| +-------------------------------------+ |
| ↓ ↑ |
| +-------------------------------------+ |
| | Domain Layer (Entities) | |
| +-------------------------------------+ |
| ↓ ↑ |
| +-------------------------------------+ |
| | Persistence Layer (Repositories) | |
| +-------------------------------------+ |
| ↓ ↑ |
| +-------------------------------------+ |
| | Infrastructire Layer (RDBMS) | |
| +-------------------------------------+ |
+-------------------------------------------+