Thursday, January 8, 2009

Eclipse Design Patterns

Will be going through following link: http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html

This is great article from past having detailed explanation on Eclipse plugin architecture..


If you are interested in summary: "

Summary and Conclusions

The plug-in extension model of Eclipse provides a powerful and general paradigm for architecting extensible systems based on loosely-coupled components. The principle use of this architecture, of course, is the Eclipse workbench. But the basic extension model is an abstract architectural pattern quite apart from its specific incarnation in the workbench.

The principle facilities of this abstract model are:

  1. Deployment-time pluggable components. Plug-ins are components that are assembled into a system at deployment time. A plug-in is implemented in a running system as an instance of a plug-in class. Characteristics of each plug-in are declaratively specified in a manifest file, which is interpreted at runtime to instantiate the plug-in and relate it to other plug-ins.

  2. Extension-points. A particular way in which a plug-in allows itself to be extended is embodied in an extension-point. An extension-point is defined by a plug-in that stands in a host role with respect to the extension-point, and may be extended by one or more plug-ins that stand in an extender role with respect the extension-point. There is a contract associated with each extension-point. The contract puts obligations on both the host and the extender plug-ins.

  3. Extensions as Parameterized Callback Bundles. An extension-point contract generally provides one or more callback interfaces, and requires extenders to provide custom implementations (callback objects) for these interfaces. Then the host is obligated to call back on these callback objects under certain conditions specified in the contract, and based on a particular extension's configuration parameters.

  4. Obligations of the Host. The host obligations under an extension-point contract may include additional requirements on the behavior of the host, such as a requirement on the host to augment its interface by additional processing elements.

  5. Obligations of the Extender. The extender describes the characteristics of an extension declaratively in its manifest file. The extension-point contract provides an XML schema for this description, and the extension specification in the extender's manifest file must conform to this schema. The schema includes slots for the concrete classes of the extension's callback objects, and for the parameters required to construct these objects. The concrete classes are furnished by the extender, and must conform to expected interfaces defined by the host. At runtime, the host instantiates the configured callback objects based on their configuration parameters."

Tracing plugins in Eclipse

Developing Eclipse plugins are fun.. and debugging those are more...

If you want to enable tracing in your plugins, the following article provides a detail explanation
http://www.ibm.com/developerworks/rational/library/06/0221_rossner/index.html

Tracing plugins becomes very useful if you are having used or implemented listeners mechanism either ResourceChangeListeners otr Java Element Change listeneres.

By enabling the tracing of these two plugins, you may get insight into which plugins are taking
time or if there is any redudancy in code.