Last post Mar 14, 2013 07:41 PM by ignatandrei
Mar 14, 2013 08:17 AM|misuk11|LINK
Im building an app and trying to implement 'proper' separation of concerns. In my solution I have a 'Core' project that contains my domain model, an MVC (4) project, an infrastructure project and a repositories project. The repositories project contains
the .edmx file created against an existing database. Ive separated out the POCOs that the .tt generator created and put them into the domain model project. As the MVC solution has also generated a Model folder, is it better practice to remove this folder
and use the domain model instead ? Obviously my models have behaviour as well as just properties so would extension methods be best here or would I be better off keeping the models in the MVC project and creating new model classes here inheriting from the
domain model classes then adding any behaviour to these new models classes ? I hope I make sense, its just I cant see why I would need 2 'Models' in my solution and as Im trying to learn the 'correct' way to architect a system I want to make sure Im going
about it the best way.
Mar 14, 2013 11:53 AM|ignatandrei|LINK
is it better practice to remove this folder and use the domain model instead ?
Mar 14, 2013 01:00 PM|misuk11|LINK
what about functionlity within the model ? I could regenerate these pocos many times after changing the database (its a database first model) would extension methods be good practice or should I create a new model class and inherit from the domain class
and add the functionality to the new class (view model classes ?)
Mar 14, 2013 01:02 PM|misuk11|LINK
Ive also seen automapper being used that maps from the view model to the poco domain model, is this a good approach ?
Mar 14, 2013 07:41 PM|ignatandrei|LINK
yes for automapper