views:

46

answers:

1

I am interested to see how people deal with decision trees when doing DDD. For example we have a requirement that when persisting new instance of particular type, some "default" associations have to be built (quite a few). User is free to change them later on though. So if one creates a decision table, how do you represent this in you domain, or do you? This is in insurance domain, so for example, if I choose one option then all related "default" benefits, options etc, get added to the policy, but user is then free to change it later on.

A: 

This is not specific to DDD per se, you would normally implement this using a Factory to create your default aggregate root. As this behavior is business specific and probably subject to change, externalizing the responsibility for object creation to the factory is better than letting the aggregate root deal with this itself.

Johannes Rudolph