Umm. I though that i would put the contexts, mappings in the ProjectName.Data project and repositories, entities, services, etc. in the ProjectName.Domain project.
However im getting a referencing problem. In Data i need to access the domain namespace and in the domain namespace i need to access the data namespace and when i add reference (Data project get reference to domain and i wanted to have domain get a reference on data) it say that it cannot because that would create a circular dependency.
Any helps ? Where each stuff normally belong to ?
Edit: I though of a better solution. Would this do ?
Domain -> Entities and domain logic
Core -> Repositories, Context and everything related to core of the application.
Services -> Services and components (sub-services)
UI -> MVC 3
I know this is up to anyone but i just need some opinions.
Well that what ive come with except “persistence” i am calling it “data”. Is there a reason why Repository Interfaces are implented to the domain ? As for UnitTests is there a Project.[each].TestUnits or you recommand one project for all unittests ?
Typically service interfaces are not defined in the domain layer because one strives to put all their domain logic in the entities.
Some services end up being stand-alone and re-usable, such as an EmailService or LoggingService. Such services are portable between other applications.
The line is foggy though when a service acts upon domain entities. That ties it to the domain, and in such a case, I wouldn’t raise a brow at seeing those particular interfaces in your domain library. The implementations should remain outside of it though.
In regards to tests, it is entirely up to you. While Praetor likes the single test project per solution, I prefer the one-to-one ratio. If somebody needed just the domain and persistence layer, I’d give them those two libraries and their respective tests.
Alright, thanks guys ! Yeah, i think this can be a good idea to put domain related services interfaces at the domain level and implement them at the service level. Application services and others kinds of services might be available only at the service level.
As for tests i might end up having one test project per project.