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:
- Pure POCO data objects / business Objects
- Repository implementation code to query data开发者_开发百科bases and external services
- 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?
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.
精彩评论