Re: Repositories Global only or contextual?
Thomas Presthus <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Organization | Erus Encodia AS |
| Message-ID | <1390389814.32405.12.camel@thinkpad> |
On Tue, 2014-01-21 at 23:28 -0600, Caleb Cushing wrote:
> The problems is that Tasks in theory represents all tasks... then I
> have a, we'll call it UserTaskBacklog that is the set of all user
> tasks for all time, Tasks cannot be removed only completed or
> obsoleted. Then there's a ToDo( Date ) which is a Set of uncompleted,
> and unobsoleted tasks, but restricted to the amount you might be able
> to complete in a day (this could fit in memory). My concern is that
> since tasks are never removed from the backlog, loading all of them at
> once could be disastrous down the line (in a dear magento, why doesn't
> your RPC API allow me to specify a limit, sort of way). I could make
> the implementation of the UserTaskBacklog know how to access the
> database, but I feel like i"m just creating another repository, and
> then shifting parts of my model implementation into infrastructure.
Who determines whether a Task is uncompleted, completed, or obsolete? Is
it the UserTaskBacklog and ToDo aggregates, or are these simply
views/projections, while it is the Task itself that knows whether it's
done?
Completing and obsoleting tasks sounds like a Task-related behavior to
me, and should probably be encapsulated in the Task aggregate.
This would render UserTaskBacklog and ToDo as mere projections of your
domain, and remove the necessity of loading all tasks into memory. As
you mention, this quickly leads you into CQRS territory, but if you have
a problem with loading your model into memory it might just be that you
would benefit from segregating the query responsibility from your
command model.
Thomas.
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/domaindrivendesign/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/domaindrivendesign/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo Groups is subject to:
http://info.yahoo.com/legal/us/yahoo/utos/terms/