End Loose Ends

DDD

How To Avoid Accessing Repositories from Domain Objects

I was reading the comments on Udi Dahan’s blog post about Domain Driven Design when I ran into a frequently asked question regarding domain classes and repository access.  Usually, the questions are similar to the following: While invoking behaviour on one aggregate root, how do I load another aggregate from a repository? How do I inject a repository instance into a domain object?    I generally prefer to tackle this problem using an approach that keeps the domain model free of storage concerns. The Obligatory Customer/Order...