I'm having trouble trying to apply DDD with EF4 (in ASP MVC2 context). Your advice will be greatly appreciated.
First of all, I started using POCO because the dependency on ObjectContext was not very convenient in many situations.
Moving to POCO solved some problems, but experience is not what I'm used to with NHibernate.
I would like to know if it is possible to use the constructor and generate not only objects, but also Value objects (ComplexType?). If I mean a Value Object, this is a class with one ctor without any specified properties (do you need a T4 modification?).
The only way I found adding behavior to anonymous entities is to create partial classes that extend the ones that edmx generates. I am not satisfied with this approach.
I do not know how to create multiple repositories with one edmx. Right now I'm using partial classes to group methods for each aggregate. In fact, each group is a repository.
Last question about IQueryable. Should it be exposed outside the repository? If I refer to a book, then the repository should be a unit of execution and should not expose something like IQueryable. What do you think?
Thank you for your help.
Thomas
domain-driven-design entity-framework-4
Tomasz Jaskuλa
source share