>>> - the dependency between DataContext and the DCEventHandler is
>>> dubious but
>>> looks unavoidable.
>>
>> 3. How about DataContext.setTransactionEventsEnabled() triggering
>> this?
>> What I am suggesting is moving static initialization block from
>> DataContext
>> to the handler itself, but making sure that it is invoked every time
>> setTransactionEventsEnabled is called in the code. Does it make sense?
>
> yes, perfectly. done.
>
> Besides looking into distributed events I'd like to:
>
> - extend/implement the standard java.util event interfaces, e.g. make
> ObserverEvent extend EventObject etc.
I don't mind letting ObserverEvent inherit from EventObject. But for
the rest of the java.util event stuff: Forget that. I've looked into
that before I modeled the observer stuff the way it's now.
Observable is not capable of distinguishing between different
ObserverSubjects, it seems that the design was more like creating an
Observable per subject.
> One more question (more for Dirk): currently the handler collects
> new/deleted/modified objects for willCommit() and messages the same
> set of
> objects again for didCommit().
Yes, that's because of the fact that by the time you want to deliver
the didCommit() message, all of the updatedObjects() etc. in
DataContext have already changed their state -> you wouldn't know whom
to send the didCommit to. So I just keep a reference to the objects
gathered in willCommit() around and release it after didCommit() was
delivered.
> Isn't that somewhat wrong? I would have
> expected that all registered objects - whether they have been modified
> or
> not - would get this event so that e.g. they can update themselves. It
> would certainly be a lot slower; I'm not sure if it makes sense?
I don't think that does make sense. I wanted to message only those
objects that take part in the current transactions, which are not
necessarily all the objects that are currently registered in the
DataContext. What good would it be to notify an object that hasn't
changed that a transaction is going on?
-dirk
This archive was generated by hypermail 2.0.0 : Sun Jan 19 2003 - 10:43:11 EST