domain driven design - DDD - Aggregate Root load/query performance -


i'm playing ddd , question pop up. how load child aggregate roots? several performance issues arise. imagine following example:

public aggregateroot1 {      #region         properties      #endregion       public aggregateroot2 ar2{get;set;}       public ienumerable<aggregateroot3> ar3list{get;set;}       (...) } 

if load aggregateroot2 , aggregateroot3 list when aggregateroot1, graph me massive. not seem nice approach.

i have 2 options:

  1. substitute aggregateroot2 ar2 guid ar2id , ienumerable aggregateroot3> ar3list ienumerable guid> ar3listids. ar references should substituted id.
  2. because don't ienumerable arlistids approach i'm thinking in remove 0...* references ar's. operations need ar's list data should made through domain services david masters sugest here

btw, i'm not considering using lazy loading.

i'm looking forward ear opinion child ar's loading. thanks

ideally, references between aggregates should identity only. option 1. however, should evaluate each reference see if required consistency of reference holding aggregate. sometimes, relationship between 2 aggregates can made aggregate loaded individually. overall, take @ effective aggregate design vaughn vernon in depth analysis of various trade-offs when designing aggregates. david masters points in linked question.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -