开发者

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

开发者 https://www.devze.com 2022-12-09 00:18 出处:网络
it seems like in my model folder, all of my classes fits into one of 3 buckets: Pure POCO data objects / business Objects

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 data开发者_开发百科bases 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消