By: Suraj Sahoo

Onion Architecture In ASP.Net MVC

The Onion Architecture was introduced by Jeffery Palermo in 2008 with the intent to make applications loosely coupled and with proper separation among the folders and the various areas of concern in the application. This makes the development easier, the testing of the application easier and the maintenance becomes easier. During the initial stage of development, the Software Requirement Specifications (SRS) is made and proper planning is done regarding what should be the approach, what technologies are to be used and then is done. The most difficult part is choosing the proper architecture so that the maintenance becomes easier. Here, the points that are kept in mind are:

  1. All code depends on layers closer to the center.
     
  2. Domain Models will be at the Center or the Core.
     
  3. The inner layer defines the interfaces whereas the outer layer implements these interfaces members.
     
  4. There is a layered behavior around the domain.
     
  5. The infrastructure for containing the data and the service implementation should be pushed to the edge. Along with the infrastructure, the UI concerns are also pushed to the edge.