I am building Asp.net core mvc application and trying to use clean architecture. We know that in DDD and in onion architecture UI layer should not depend on infrastructure layer and persistence layer. I can't fully understand this concept because if I won't reference infrastructure layer and persistence layer from UI Layer which is my asp.net core mvc application how I can register concrete implementations on abstractions in IOC container in startup class?
1
votes
1 Answers
2
votes
What does it mean when applications one layer is not dependent on another
In practice, it means that we should be able to replace an outer circle without requiring changes to the inner circles.
In Uncle Bob's specific example, I should be able to replace the Controller and the Presenter without also needing to change the Use Cases.
Your startup class, aka the Composition Root, is responsible for wiring together all of the different pieces so that they can communicate with each other.
See also: Boundaries, by Gary Bernhardt.
