Question

I would like to separate my MVC (.Net) website in different projects following 3-layer architecture:

  • Data Access: Model
  • Business Logic: Repositories
  • Presentation: Controller, View

Is my structure correct?

Was it helpful?

Solution

MVC and a layered architecture can be used in different ways, so it's not about right or wrong here. The common ground is that the view part is always in the presentation layer.

Then you can have your controllers either in the presentation layer or in the business layer. For simpler applications, there is sometimes no distinction between a business layer and the controllers.

There can be several model parts in a tiered application. The data access layer definitely needs a model. This model can be shared among the layers, or can be transformed into different models that may be better suited for the presentation layer.

Often the MVC pattern is used inside the presentation layer only, or rather the presentation layer is realized using the MVC pattern.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top