Quantcast
Channel: User Filip Milovanović - Software Engineering Stack Exchange
Viewing all articles
Browse latest Browse all 164

Comment by Filip Milovanović on Is it valid for two small aggregates to have the same root in DDD?

$
0
0
You can load database entities partially into different objects or aggregates based on context, and have different behaviors when writing them back. You can also consider relying on the compiler to enforce some invariants via type checking - for example, maybe you could have the OpenShipment type, and require all non-constructing operations on open shipments within a certain part of the app to accept or work with only that type. Then you'd have some function or a factory object that encapsulates the rules around opening or closing shipments, and produce one type of shipment from the other.

Viewing all articles
Browse latest Browse all 164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>