What is Onion Architecture?
Jeffrey Palermo coined the Onion Architecture term in 2008
This architecture provides a better way to build applications for better testability, maintainability and dependability on the infrastructures like databases and services
What are the Advantages of Onion Architecture?
- It provides better maintainability as all the codes depend on layers or the centre.
- It provides better testability as the unit test can be created for separate layers without an effect on other modules of the application.
- It develops a loosely coupled application as the outer layer of the application always communicates with the inner layer via interfaces.
- Any concrete implantation would be provided to the application at run time
- Domain entities are the core and centre part. It can have access to both the database and UI layers
- The internal layers never depend on the external layer. The code that may have changed should be part of an outer layer.