7

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?

leora
  • 188,729
  • 360
  • 878
  • 1,366

1 Answers1

3

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.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
queen3
  • 15,333
  • 8
  • 64
  • 119
  • It looks like the link to SharpArchecture.net has died. :/ – Charles Burns May 01 '15 at 19:01
  • Well, you can google for it. Seems that they even have a package for NuGet (https://www.nuget.org/packages/sharp-architecture/). But I haven't use it for some time. Anyway, the article on CodeProject is still available and it explains the best practices to be used with any architecture. – queen3 May 02 '15 at 08:02