noodle22
Programmer
- May 8, 2008
- 23
What are typical project/namespace organization for a DB project (including accepted names...maybe people don't name things accessors)? I have been doing something like
*[project].Core.Entities - contains entity objects. Should this be called Domain or DomainObjects?
*[project].Core.Repository - contains interfaces that access the database. Currently, I name these something like I[Entity]Accessor so IStoreAccessor for saving/getting/etc store entity object(s). I'm thinking that maybe I should rename Accessor to Repository so IStoreRepository
*[project].DataAccess - contains concrete implementation of the [project].Core.Repository interfaces. It encapsulates my nhibernate code and/or ADO code. And then I have some sort of class (I guess it would be a factory) that returns instances of the I[Entity]Accessor interfaces when I need to grab data from the db
*[project].UnitTests - I'm just starting to learn about TDD so I don't know too much about this one but I guess it will contain my unit tests
lately, I have been trying out ASP.NET MVC (and I can't say enough good things about it) so my web project has the following namespaces
*[project].Controllers
*[project].Views
I really appreciate any guidance in this. I think I am on the right track now and maybe the remainder of what I am trying to figure out is subjective (ie Accessor vs Repository, Entity vs Domain)
*[project].Core.Entities - contains entity objects. Should this be called Domain or DomainObjects?
*[project].Core.Repository - contains interfaces that access the database. Currently, I name these something like I[Entity]Accessor so IStoreAccessor for saving/getting/etc store entity object(s). I'm thinking that maybe I should rename Accessor to Repository so IStoreRepository
*[project].DataAccess - contains concrete implementation of the [project].Core.Repository interfaces. It encapsulates my nhibernate code and/or ADO code. And then I have some sort of class (I guess it would be a factory) that returns instances of the I[Entity]Accessor interfaces when I need to grab data from the db
*[project].UnitTests - I'm just starting to learn about TDD so I don't know too much about this one but I guess it will contain my unit tests
lately, I have been trying out ASP.NET MVC (and I can't say enough good things about it) so my web project has the following namespaces
*[project].Controllers
*[project].Views
I really appreciate any guidance in this. I think I am on the right track now and maybe the remainder of what I am trying to figure out is subjective (ie Accessor vs Repository, Entity vs Domain)