Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jwt-dev] Good dev practices : writing extension points

Hi all

On the more generic topic of extension point coding :

* extension point code should be externalized in its own class(es). At least code that reads in the plugin registry should be externalized such. Thanks to this, there will be no more registry introspection code lost in UI classes !

* for extensions that are made to configure a choice of implementation(s), there should be an Xxx interface that these implementations have to implement. Often there should also be a descriptor or factory interface (XxxDescriptor or XxxFactory) that is read and configured from the registry and know how to instanciate said implementations. Possibly there should be a dedicatedXxx(Descriptor/Factory)Registry interface that gives access to them.

* there are already in JWT several patterns or code snippets that do this. * look at how Mickaƫl does in ex. PropertyDescriptor ExtensionPoint : a singleton class to hold the extension point code, and other interfaces from there * things more in line with what is done in EMF is good for low-level stuff, like is done in aspects / profile code (jwt-we-conf-model : look at AspectFactory interface and singleton impl)

Regards,
Marc


Back to the top