Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC Application Design

Ok, So I have been taking in all sorts of great information about MVC, EF4, Repository Pattern, UoW, Service Layers, etc and now I am going to attempt to put it all together.

My question is, How should these be separated?

I was thinking projects like this:

1) Application - MVC App
2) Repository Layer 3) Entities - EF4/Partial Entity Classes

Any suggestions would be great!!

Thanks, Sam

like image 445
Sam Avatar asked Apr 07 '26 07:04

Sam


1 Answers

Here's one example of how you could structure your application:

  1. Domain Models (Primary POCO objects)
  2. Repositories (Implementation of some data access technology depending on the project requirements : EF, NHibernate, LINQ to XML, Remote web service calls, ...)
  3. Service (business operations aggregating multiple CRUD operations into a business operation that will be exposed with the domain objects)
  4. ASP.NET MVC application (Controllers, Views, View Models, Mappers between the Domain objects and the view models)

This layers could represent a physical separation (assemblies) or logical separation into the same assembly.

like image 169
Darin Dimitrov Avatar answered Apr 08 '26 23:04

Darin Dimitrov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!