Role/snapshot objects
I have become quite fond of using role objects at the boundaries of aggregates. For example, assuming an OrderLine
has a Product that would most probably be implemented as a ProductOfALineItem role object (value object) in a
Domain Model of mine. (Hmmm, but a better name would be needed...)
I think that in many situations this helps isolation, performance and timing issues. I arrived at this solution
the hard way (and called those objects snapshots). My friend Kim Harding Christensen uses Roles a lot in his
designs, and he was inspired by Modeling in Color. It's fun to see how different routes can lead to similar
solutions.
:-)