Summary


All these years and this topic still feels a bit immature and with no obvious solutions. That said, we have touched on several ideas for how to deal with rules, some typical and some a little more atypical.

We discussed quite a lot about rule objects as an implementation technique, but we have also touched on other variants. As always, no solution is the best for all situations. For example, the rule objects I sketched were probably most appropriate for pretty simple rules and if you have many rules.

The major takeaways in this chapter were probably that you should try to decouple persistence and the domain-related rules as much as possible. (Still, there are connections for some of the rules.) Working with different states is a very powerful solution for getting close to the "all states should be savable" goal. Finally, remember that the rules are very context-connected, and try to focus on the model meaning of the rules.

In this chapter, we have dealt with many of the feature requests defined in Chapter 4, but now we will move on to the needed infrastructure, with a focus on persistence support.




Applying Domain-Driven Design and Patterns(c) With Examples in C# and  .NET
Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
ISBN: 0321268202
EAN: 2147483647
Year: 2006
Pages: 179
Authors: Jimmy Nilsson

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net