On 2010-10-28 23.55, Marc Grue wrote:
For your information, I did some evolving qi4j implementations of a DCI
money transfer example that could be interesting for those of you flirting
with DCI. See more here:
http://groups.google.com/group/object-composition/browse_thread/thread/643ba009b1648cd0?hl=en#
Java/Qi4j Money Transfer example in 6 versions
In the 6th and most advanced version, I imitated Transactions=Conversations
and TransactionEntries=Messages from Streamflow as, erm, role models.
One thing I was not sure about from a qi4j point of view was if implementing
a roleMap as a @Service is viable. I'm not stacking contexts, so it seems to
work so far.
As a followup to Marc's samples, I reworked them and replaced the
current DCI samples in the qi4j-samples module. They now use stacking
contexts, where the context is essentially the rolemap, so it's all
statically typed and the usage is very simple.
The only remaining issue is how the context is pushed on the stack,
which is kinda ugly. To fix that I need Concern's on POJO's. So,
basically for v1.3 we could also consider implementing Concerns,
Constraints and SideEffects on POJO's, which would solve that. If we
subclass POJO classes it should be reasonably easy to insert concerns,
at least generic ones. Then the DCI code becomes supersimple, and you
get to use the Constraint goodness for simple validation.
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev