Search code examples
asp.netasp.net-mvcarchitecture

ASP.Net Architecture regarding seperation of layers in large projects


Currently in the early stages of developing a very large project using ASP.Net MVC.

At present we are using the standard format (Ie Folders for each of the Models/Views/Controllers) Already I am starting to see a large codebase that has the potential to multiply 100x over and for the sake of future maintainability I'm considering moving all the Models and Business logic into a separate class library, leaving the controllers and Views in the MVC project.

Does anyone have any thoughts on this? Has anyone had a similar experience?


Solution

  • You absolutely should move your models in business logic into a separate library or libraries. I do this even for very small sites. There is essentially no disadvantage, and it allows you to use your models and business logic in non-web applications.

    To clarify, I keep view/presentation models in the web project, and entity/domain models in the separate, model library.