Home
Do You Use a Dependency Injection Centric Architecture ?
  v6.0 Posted at 30/06/2014 9:45 PM by Tiago Araujo
inject Figure: Bad Example – N-Tiered architectures do not inherently support dependency injection inject Figure: Good Example – The Onion Architecture promotes layers built on interfaces, and then injecting dependencies into those layers. This keeps coupling low, and therefore maintainability high

The classes in each layer can depend on layers toward the centre.

It emphasizes the use of interfaces for the business logic and repository layers. The repository layer corresponds to the Data Access layer in an n-Tier architecture.

An n-Tier architecture has at its base the database.
The core of the onion architecture is the Domain Model, and all dependencies are injected. This leads to more ​maintainable applications since it emphasizes separation of concerns.

Further Reading:

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments:

    Note: Social Media login for Yotpo is not working in IE or Safari, please use Chrome. We are waiting for Yotpo to fix it.