Reputation: 123
I am learning and working out a sample project applying onion architecture and domain driven design.
As per my understanding I have drafted a small presentation and attached as an image in this post.
I need clarifications on layers of onion architecture and its implementation. Could you explain based on my presentation?
Core Project:
Domain Layer - entities, value objects, aggregate root, domain exception objects.
Domain Service Layer - business logic contracts.
Infrastructure Service Layer - persistence contracts, repository contracts, email and sms contracts, domain events and integration events contracts.
Application Service Layer - orchestration of infrastructure and domain service interfaces for uses cases.
Indentity Project:
Web Api Layer - controllers, configuration, composition root etc.
Infrastructure Layer - persistence implementation, repository implementation, email and sms implementation, message queuing etc.
Where would I implement contracts of the domain service layer from core project?
Upvotes: 3
Views: 2514
Reputation: 683
The Onion architecture is cut into these layers :
In your exemple, you have two projects, each project is an onion with all layers.
In addition, don't forget to design/cut your Subdomains with the business expert views. Technical considerations are not a good way for this.
Upvotes: 4
Reputation: 104
Well, as I understand the Onion architecture, there is a domain layer that, in terms of DDD, includes aggregates, entities, value objects, repositories (interfaces) and domain services.
Then, the application service layer, that orchestrate the domain stuffs.
Then, the infrastructure layer and the last, the Web Api layer.
The rule here is a layer cannot use nothing from above layer.
Upvotes: 1