Claude Warren commented on JENA-189:
------------------------------------

I was writing from memory and seem to have gotten the layer wrong.
Yes, ModelChangedListener does what I was saying.  Is there something
similar for the Dataset?


Not yet - the choice I see is whether to add this into the core of the datasetgraph code or to add it as a wrapper dataset that sends events.

At the moment, I'm more inclined to put it as a wrapper e.g.

public void add(Quad quad)
{
    send "add" event(getWrapped(), quad) ;
    getWrapped().add(quad) ;
}

The other choice is the style of event system: publish-subscribe or object-notification. The current graph one is object-notification -- the object where the event happens sends out the notification.

In publish-subscribe, you can have event about an object without the object being involved. An event manager sends out events, not the object the event is about. Code registered with the event manager to listen, not with the object itself.

I've had to use this elsewhere (org.openjena.atlas.event.EventManager) but it is a complicated design. Maybe the object-notification is needed for convenience but it uses the publish-subscribe style for implementation.

What are the use cases beyond listening to quad add and quad delete?

        Andy

Reply via email to