Skip to search.
domaindrivendesign · Domain-Driven Design

Group Information

  • Members: 2907
  • Category: Software
  • Founded: Sep 27, 2002
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

  Messages Help
Advanced
Repositories vs. DAO's / Finders / QueryHelpers   Message List  
Reply Message #309 of 23085 |
RE: [domaindrivendesign] Repositories vs. DAO's / Finders / QueryHelpers

> steve_molitor2003 wrote:
>
> > If I understand correctly, a repository lets clients of the domain
> > model find aggregate roots. Clients can only find aggregate roots,
> > and only through repositories. Clients traverse explicit
> > associations from the aggregate root to obtain other objects. An
> > association method may be internally implemented through a DAO or
> > somesuch, but clients don't know that. So repositories are explicit
> > domain objects exposed to clients; DAO's (or whatever) are 'private'
> > implementation details.
> >
> > I really like this distinction, because it allows you to control
> > associations. With public DAO's or finder methods for every entity,
> > explicit associations don't mean much. Clients can call
> > parent.getChildren(), or they can bypass the association method and
> > call ChildDao.findByParentId(parent.getId()) directly. Chaos.
> > Explicitly exposing the query methods clients are allowed to call via
> > repositories, and only allowing 'queries' to aggregate roots is a
> > great idea.
> >

This is a great summary of the benefits of repositories.

I agree with J.B. about "helpers". Some of those other naming schemes amount
to about the same thing. J.B.'s suggestion of query factories seems
reasonable. Something like XxxAssociationQuery seems pretty descriptive, if
you can limit its scope to be used according to aggregate rules.

In any case, you seem to be on the right track.

Eric




Sat Jan 3, 2004 12:53 am

ericevans0
Offline Offline
Send Email Send Email

Message #309 of 23085 |
Expand Messages Author Sort by Date

I have a minor minor domain model implemenetation detail that's been nagging me a bit. It's really more of a naming issue than any thing else. If I understand...
steve_molitor2003
steve_molito... Offline Send Email
Jan 2, 2004
1:54 am

... I dislike "Helpers". They're procedural and the more of them I have, the less easily I see other opportunities to refactor. What if you called them query...
J. B. Rainsberger
nails762 Offline Send Email
Jan 2, 2004
3:28 pm

... This is a great summary of the benefits of repositories. I agree with J.B. about "helpers". Some of those other naming schemes amount to about the same...
Eric Evans
ericevans0 Offline Send Email
Jan 3, 2004
12:46 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help