Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do you organize your model code in asp.net-mvc?

it seems like in my model folder, all of my classes fits into one of 3 buckets:

  1. Pure POCO data objects / business Objects
  2. Repository implementation code to query databases and external services
  3. Helper code.

Is this normal and is there a best practices on how to organize this. should i have subfolders for 1, 2 + 3? any recommendations?

like image 954
leora Avatar asked Oct 18 '09 18:10

leora


1 Answers

If you look at http://www.sharparchitecture.net which tries to provide a best practices framework, you'll see that POCO/entities, repositories and helper code are not only separated, they also exist in different assemblies. This is so that it's physically impossible to leak from one container to another. This framework grew from http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx article which is also good to read.

like image 83
queen3 Avatar answered Oct 02 '22 16:10

queen3