NHibernate: Avoiding complete in-memory collections when working with child collections via aggregate root?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

I would create a specialized method on your repository, which returns the oldest child of a given parent.

Yeah, this is the best I could think of, and probably ok from a pragmatic point of view. My concern was that it breaks the (DDD) 'rule' that you should access child objects by traversal of the parent (aggregate root) object's collections, rather than returning to the repository (ref. Point a.In the question) – UpTheCreek May 1 at 15:55 I wouldn't consider accessing child objects directly to be a DDD anti-pattern, however I would consider updating child objects directly to be a no no.

The aggregate root needs to be involved to enforce invariants and other business rules. Reading and updating are very different and this is one of the reasons why CQRS is popular in the DDD community. – Michael Valenty May 1 at 16:25 Thanks @Michael - food for thought.

I'm glad that the consensus seems to be straighforward. I've no experience with the CQRS concept, but I'll also take a look at this at some point. – UpTheCreek May 1 at 16:48.

You could map OldestChild using a Formula. Take a look at this to map a class to a formula: blog.khedan.com/2009/01/eager-loading-fr....

Interesting - I'll take a look at this, thanks. – UpTheCreek May 1 at 15:58.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions