Re: Repositories Global only or contextual?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
Let's look at it this way: 1) is OOP required for DDD? Interface is OOP concept. What do you do in a language without interfaces? 2) Interface method have specific concept in the domain: specification. Interface methods usually map 1:1 to some specification (there are slight differences but let's ignore it for now) 3) Client never talks about repository, thus this is an infrastructure concept which binds application and the model (as you quoted) 4) While some would argue that generic interfaces suffer from leaky abstraction problem, I would beg to differ, since those problems are mostly related to object-relational mismatch I'm due to provide code examples of what I'm talking about and plan on doing that as soon as I find some more free time. While lazy loading is an optimization mechanism, this is something you should not ignore in your infrastructure. All too often I hear people talking about DDD saying how performance is not important. This is simply not true for any non-trivial project. And IQueryable from .NET is more about lazy materialization, then lazy load. Regards, Rikard