Onion Architecture
Onion Architecture is a software architectural patterns that emphasizes the separation of concerns and dependency inversion.
Layers of Onion Architecture
- Core (Domain) Layer: Contains the business logic and domain entities. This layer is independent of any other layers and does not depend on external libraries or frameworks.
- Application Layer: Contains application-specific logic, such as use cases and services. This layer coordinates the flow of data between the domain and outer layers.
- Infrastructure Layer: Contains implementations for external concerns, such as data access, messaging, and other services. This layer depends on the application and domain layers.
- Presentation Layer: Contains the user interface and API controllers. This layer depends on teh application layer and interacts with the user or external systems.
Concepts related to each Layer
- Core (Domain) Layer
- Domain-Driven Design (DDD)
- What is the relationship between DDD and "Onion Architecture"?
- Interfaces
- Entities: Objects with a unique identity, state and behavior
- Value Objects
- Aggregates
- Application Layer
- Services
- Infrastructure Layer
- Repositories
- Data Source
- Presentation Layer
- Controller