On Fri, May 9, 2008 at 4:12 PM, Rickard Öberg <[EMAIL PROTECTED]> wrote: > Niclas Hedhman wrote: >> I think that either; >> >> a) Don't require the registration, and instead let UoW explicitly >> know of a MixinType that signals the callback. >> >> or >> >> b) Allow anyone to register synch callbacks, in which case the >> Entity instance must also be passed in the sync calls. > > For b), the registered synch could already have a reference to the > Entity(ies) it wants to validate, so it doesn't have to be passed. The > ValidatableMixin already does this, in a sense (check the code I > committed yesterday).
My point is that this may not be true for external validators, who may not know which entities has been involved in the UoW. Perhaps this should only be the case for "Specification" level, where a a complete list is handed over. > "instanceof" checks on every entity which seems slow. "slow" ;o) Compared to storing the Entity in a database?? I have not enough conviction of what is better. Both has advantages. In one case we will need a new API interface and impose a "slow instanceof" on every modified Entity during the complete(), and in the other case their is a larger memory footprint, a "slow setup", and possibly "slower 'find out if going to validate'" (GutFeeling only) but only when validation is enabled. From my PoV, it is "either way". Perhaps > The name was copied from JTA, and in a sense it is so bad that it *has* > to be changed. Having slept on it, here are some options: :o) > *Listener: problem is that beforeCompletion throws exception, so not a > strict listener > *Notification: same problem as with Listener > *Callback: works, since it's a generic name, but might be too generic > *Validation: this captures what one would typically do, and works very > well with the most common case, i.e. ValidatableMixin registering > itself. Only problem I see with this is that one might want to register > things that does not just do validation. * Maybe something along "Judgement", as in courts. * Maybe something along "Approve", "Approval" and "Approver" ?? * Maybe something along "Inspection", "Inspector", as an inspection can fail. Just some ideas. Cheers Niclas _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

