Layer ASP.NET MVC Project

keyser

New Member
I am trying to understand the concepts of a good designed project.I am using ASP.NET MVC and i am trying to create a layered (pluggable) project.The current project structure what i have now is this:[*]\[code\]LayeredProject\[/code\] - the MVC Project containing Controllers[*]\[code\]LayeredProject.EntityFramework\[/code\] - contains all the POCO classes used for database. (i am using Code First approach)[*]\[code\]LayeredProject.Model\[/code\] - this should contain all the business objects used in the project.Saying that the project is a eCommerce website, i would structure it like this:
  • In the \[code\]LayeredProject.EntityFramework\[/code\] project i have classes which corresponds to the database tables. Category, Product, User. This project is used only for saving and loading data from database, and those objects should not be used for other purposes. This project has a reference to \[code\]LayeredProject.Model\[/code\] project.
  • In \[code\]LayeredProject.Model\[/code\] project i store all the objects i work with, which most of them are exactly copies of \[code\]LayeredProject.EntityFramework\[/code\] POCO's objsects and some other Services Classes used.
  • In \[code\]LayeredProject\[/code\] i keep all my ViewModels classes, Controllers, and different UI logic. This project has a reference to \[code\]LayeredProject.Model\[/code\] project.
First of all, i am not sure that this is the right way of doing this.And, it this is the right way of doing it, then i get a little confused because i will have a duplicate of my POCO classes in \[code\]EntityFramework\[/code\] project and also on \[code\]Model\[/code\] project.Please help me understanding this
 
Back
Top