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.
>
> 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?
1. What we use to implement the component registry and extension points?
2. Or what we use to implement the EventService service?

These are 2 different questions.
1. NX components are implemented very close to the declarative services
specified by OSGi.
There is a central registry of components (ComponentManagerImpl) and
each component provides several extension points.
So the NXRuntime provides a sort of OSGi service registry (it is not a
fully OSGi service registry because it is not following all osgi specs).
When an extension is registered the component declaring the target
extension point is retrieved from the registry and its method
registerExtension(Extension extension) is called - resgistering thus the
extension.
You may view extension points as a very specific type of listener if you
want - but this is not exactly the same -
you cannot have more than one extension point to be notified for an
extension.
You can view extension points very specialized type of listener.
So the response for your question is that extension points are following
the whiteboard pattern.

2. The EventService is an NXRuntime component that provides an event
service.
This service is not using the component registry as listener registry -
it is using a specific composite registry maintaining sub-registries
grouped by topics.
To send an event you get the EventService component from the component
registry and send it the event. The Event Service will forward the event
to all listeners registered for the event topic.
So all listeners are kept in a central regsitry - but not as services
(or components).
So I think this is following the whiteboard pattern too.

Bogdan

>
> 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


-- 

Bogdan Stefanescu - Apogee project Team Leader

Nuxeo - Open Source ECM - www.nuxeo.com
Apogée - the rich client platform for ECM
http://apogee.nuxeo.org/ - http://www.nuxeo.com/en

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

Reply via email to