Re: Repositories Global only or contextual?

Thomas Presthus <[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Organization Erus Encodia AS
Message-ID <[email protected]>
On Tue, 2014-01-21 at 10:59 -0600, Caleb Cushing wrote:
> It would seem though, assuming a user could have a /lot/ of tasks,
> that I would end up writing another implementation class as a set that
> then has to know how to fetch from the database, because the Set
> returned would have to be able to lazy load Tasks.


That's really an infrastructure concern. Be careful not to fall into the
trap of premature optimization. Your domain should rather depend on an
interface that describes fetching Tasks for a User. Using a
ports-and-adapters-architecture, you can then implement repositories
fulfilling this interface however you like.


Thomas.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.