On 8/1/11 17:48 , Niclas Hedhman wrote:
Hi,
I am reading Vaughn Vernon's draft for Ch10 "Aggregates" in his
upcoming book. Well, he is requesting comments/feedback...
The overall theme is that the Aggregate is the consistency boundary,
and from that he derives all kinds of conclusions. One of the
conclusions are that although one Aggregate can hold a reference to
another Aggregate, it is only allowed that one of them are modified in
the same transaction.
This sounds like one thing that we could actually enforce in Qi4j if
we wanted to. If enabled, only entities retrieved via an @Aggregated
association can be modified in the same UnitOfWork.
WDYT?
This touches upon similar things that I've been thinking about actually.
There are two cases where something similar would be useful.
The first is if you have Entity A with association to Entity B. If B is
removed, then Entity A is essentially invalid, and cannot really be
fixed. There will be all sorts of loading errors. If B however could be
loaded just as a reference, but which creates errors on calls, then A
could be "fixed".
Secondly, I'm adding Associations to Values. Essentially, if you declare
an Association in a Value, then it is resolved upon get() against the
current UnitOfWork. If no UoW is active, then either an exception could
be thrown *or* a similar "fake entity" could be used, just as a marker
that can be passed around for reference purposes.
The above would sort of be in the same category, as referenced entities
"outside of scope" could be referenced and passed around, just not invoked.
Something like that?
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev