On 16 Oct 2006, at 15:37, Jean-Marc Orliaguet wrote:
Florent Guillaume wrote:
On 16 Oct 2006, at 14:15, Florent Guillaume wrote:
The whiteboard pattern for events and dependencies is defined here:
http://www.osgi.org/documents/osgi_technology/whiteboard.pdf

Apparently the traditional Java pattern for synchronous event subscription (used for extension) is of having each subscriber for a given kind of event register with the event source -- the event source maintains a list of people interested in it. This pattern doesn't scale well, as the paper above explains, and has many disadvantages (debugging, event observing, additionnal classes needed, vector allocation, etc).

The Zope event model of having a registry between the event source and the event listener is much better, and that's roughly what OSGi calls the "whiteboard" pattern. In the Zope case the registry is the adapter registry, in OSGi the bundle registry is used.

I mean, the service registry, of course.


Some people much prefer the whiteboard pattern over Eclipse extension point:
http://www.mail-archive.com/[email protected]/msg00091.html

My question is: how does this compare to what we use in NXRuntime? What's our pattern?

Florent

I think that's more or less what I have in:
http://svn.nuxeo.org/trac/nuxeo/browser/NXThemes/NXThemesCore/trunk/ src/org/nuxeo/theme/events

EventManager.java is the event registry, event types are stored in a central type registry.

all event listeners (handlers) have an event type, and the event type is used as a key to look up events by type.

event sources call a Manager.notify(context) by passing an event context (with the event source and the event target), and the event manager finds listeners and call handle(context) on them

but that's more or less the way it was implemented in CPS3 already, with a central registry?

What the paper advocates is to reuse the OSGi registry itself as the central registry for this kind of thing. It's able to do matching on arbitrary properties to find the service/ component to use.

It's very possible you won't like it because it reminds you too much of the central Zope 3 adapter registry :) But I'm sure this has advantages.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to