开发者

ASP.Net Architecture regarding seperation of layers in large projects

开发者 https://www.devze.com 2022-12-10 13:27 出处:网络
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) Allready I am sta

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) Allready 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 Buisness logic into a seperate class library, leaving the controllers and Views in the M开发者_如何学编程VC project.

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


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.


Take a look at S#arp architecture.

It separates the Model, the Controllers and the Service layer in separate dlls.

It has also the concept of areas (that was recently also introduced in MVC2)

It's one of the best examples you can find for an MVC architecture for large projects.

0

精彩评论

暂无评论...
验证码 换一张
取 消