Isn't this a good candidate for AOP ? So when a child entity's version is updated, whether by NH or externally, you go and update the aggregate root(s) too.
If you see this as a business decision, and don't want to put it in AOP, may be an event driven solution would do ? Child publishes HeyIHaveBeenUpdated event and have aggregates subscribe to it. Am I thinking too simple and missing something ? On Mon, Apr 27, 2009 at 4:51 PM, Greg Young <[email protected]> wrote: > > Yeah that's about what I thought ... it gets ugly also when you start > going n levels deep and end up having to walk bunches of > bi-directional relationships. This is something that really needs to > be a first class concept to work without being too complex. > > I was hoping some people had some brilliant solution that had just alluded > me :( > > makes me curious though how exactly so many people are doing "DDD" > with nhibernate? I am suspecting more and more that these people are > in fact not doing DDD at all but instead are doing "DDD as a pattern > language". you can force everything through the aggregate and touch > its version but yuck! > > Cheers, > > Greg > > On Fri, Apr 24, 2009 at 4:00 AM, Peter Morris <[email protected]> wrote: > > > >> > > I see what you are saying .... build an interceptor ... then make my > > root traversable from all thechildren .. have interceptor make the > > session.Update call .. Is that correct? > > < > > > > It's the way I have done it in ECO (capableobjects), I make each part > > implement IAggregatePart which has a GetRootObject I can call to ensure > the > > root is updated too. > > > > If you are using Created/Modified etc on a Repository rather than using > it > > only as a query mechanism then the repository can do that for you, > because > > the only way to call Update to save the child is to go via that > Repository. > > > > > > Pete > > ==== > > http://mrpmorris.blogspot.com > > http://www.AlterEgos.com - Who do you want to be? > > > > > > > > > > > > > -- > It is the mark of an educated mind to be able to entertain a thought > without accepting it. > > > > -- Sidar Ok http://www.sidarok.com http://www.twitter.com/sidarok --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
