Saturday, March 3, 2012

Five basic concept for Eclipse RCP / IDE / Plug-in 



1) Eclipse IDE  and RCP application -
             The Eclipse Platform is a composition of  software components. 
              The Eclipse Platform contains the functionality required to build an IDE.  

The Eclipse IDE is a collection of specific software components as shown below.




- Eclipse RCP application  is set of independent plug-ins 
       (Standard RCP plug-ins +  Software vendor plug-ins == RCP Application)

- Developing RCP application is developing eclipse plug-ins.

- Eclipse RCP is based on component model.
     - plug-ins are basic building blocks of this model
           - plug-ins are based on OSGi 



- Advantages of Eclipse Rich client platform architecture:
    a) Maintainability
    b)  Extensible - seamless integration of tools
    c)  Re-usability
 
- Differnce between Extensible application Vs RCP application:
     
Example of Extensible is Google browser add-on


3) What is plug-in ?


 - Plug-ins are basic building block/ software component  of eclipse.
 - Each plug-in is an OSGI (Open Service Gateway Interface) bundle
-  An RCP application is set of plug-ins.
         Developing Eclipse RCP App. == Developing Plug-ins
-Plug-ins can provide provide / consume services of other plug-ins.


- Services by
    a)  defining Extension point
    b) contributing to existing extension point
    c) dependencies to other plugin


 - Each Plugin extend  "org.eclipse.core.runtime.Plugin" class,  which provide generic facility of activation / deactivation of plugin.
        - When a plugin is involved in interaction with GUI components, then it must extend         org.eclipse.ui.plugin.AbstractUIPlugin.





 - Plugin Contains declarative and programmatic part,  declarative part read during eclipse start-up  and cached in the plugin registry , which will be accessed by Plugin registry API.


  eg: 
       Plugin pInfo = Platform.getPlugin(pluginID);
              pInfo.isRunning();


-  Follow naming convention for plugin
     com.vendor_name.project_name.plugin-name



3) Eclipse Plug-in architecture -
  - MANIFEST.MF - contain OSGi configuration information, dependency
          http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
   - plugin.xml -  contain information about Extension and extension-point
              http://wiki.eclipse.org/FAQ_What_is_the_plug-in_manifest_file_(plugin.xml)%3F






  - Plugin can be created without plugin.xml
       example: wrapping third party Jar as a Plug-in.


4) Extension / Extension Point :
                                                           
        - Extension point is a logical socket available to other Plug-ins.
        - Each plug-in can define 0 or more Extension points
        - It enable other to contribute to your contribution
        - It reduces coupling and increase cohesion
        -  Promote modularity and re-usability
        -






5) Plug-in Life Cycle :-

-It is possible to track plug-in start-up and shutdown event using overriding start(BundleContext)  and 
stop (BundleContext) in  Activator class.
 - BundleContext inreference to underlying OSGi infrastructure.
- Plugin should be loaded only when required (Lazy loading) using Eclipse-Autostart ="true"
- Eclipse Runtime uses OSGi as a low level Framework for the Plugin
- Each plugin is an OSGi Bundle.


For each state detail. Please see 1) Plug-in Life Cycle state 2) OSGi





Reference Material:
http://www.programcreek.com/2011/09/eclipse-plug-in-architecture-extension-processing/
 http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html

2 comments:

  1. Very nice info...
    Thanks for sharing.

    ReplyDelete
  2. Really helpful concepts.
    Thanks for sharing.

    ReplyDelete