What is the relationship between Domain-driven design (DDD) and "The Onion Architecture" of Jeffrey Palermo?
The Infrastructure Layer is the outermost layer of the Onion Architecture. It's responsible for implementing all the IO operations that are required for the software. This layer is also allowed to know about everything contained in the inner layers, being able to import entities from the Application and Domain layers.
Clean Architecture was introduced by Robert “Uncle Bob” Martin in 2012 in this post. It builds on the concepts of Onion Architecture but with somewhat different details of the layers. Instead of “Domain Model”, it refers to the core as “Entities”, but still representing enterprise-wide business rules.
Domain-Driven Design - Layered Architecture.
Domain-Driven Design(DDD) is a collection of principles and patterns that help developers craft elegant object systems. Properly applied it can lead to software abstractions called domain models. These models encapsulate complex business logic, closing the gap between business reality and code.
If you look at the image that describes the onion architecture in the link you provided, the Domain Model layer is what DDD focuses on.
Onion is an architectural pattern for a system, whereas DDD is a way to design a subset of the objects in the system. The two can exist without eachother, so neither is a subset of the other. If you were to use them together - then as a whole the part that is designed using DDD would be a subset of the entire system.
To use a (probably bad) analogy: Onion is a pattern to design a house, and DDD is a way to mill the wood that is a part of the house.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With