Presentation is loading. Please wait.

Presentation is loading. Please wait.

On Platform-Plugin Architecture Take Eclipse as an Example 魏恒峰.

Similar presentations


Presentation on theme: "On Platform-Plugin Architecture Take Eclipse as an Example 魏恒峰."— Presentation transcript:

1 On Platform-Plugin Architecture Take Eclipse as an Example 魏恒峰

2 Overview Motivations for Plugins What is platform-plugin architecture? Eclipse Example  platform  plugin  extension model Runtime consideration Some challenging issues

3 Motivation for Plugins(1) Customers' requirements control the creation and deployment of software. rapid changes in requirements upgradeablity support for integrating other vendor's compents at any time more flexible and extensible

4 Motivation for Plugins(3) What can we do …… ? traditional software architecture  add new functionality  modify existing functionality  add new functionality again  modify existing functionality again  …… What a mess!

5 Motivation for Plugins(4) How about Platform-Plugin Architecture?  providing modular functionality to users  platform is small + integrated  offer a consistent use experience  Support composing a larger system that is not pre-structured, or to extend it in ways you don't foresee. Maybe elegant

6 What is Platform-Plugin? Sounds familiar…… History: While working on Silicon Beach Software’s Digital Dark-room--one of the first digital imaging programs--programmers envisioned using XCMD-like bits of software to extend Digital Darkroom’s capabilities to include access to flat-bed scanners and software “filters” that could manipulate a photograph’s look. They called this concept a “plug-in” and the name stuck.

7 What is Platform-Plugin? more familiar…… Actually , it is much more than a wonderful IDE……

8 What is Platform-Plugin? A platform describes some sort of hardware architecture or software framework (including application frameworks), that allows software to run. —— from Wikipedia A plug-in is a structured component that contributes code (or documentation or both) to the system and describes it in a structured way.

9 Eclipse Platform Architecture(1) Platform Runtime: Finding,loading,and running the right plugin code. Maintaining a registry of installed plugins and the functions they provide. Managing the plugin extension model and inter-plugin dependencies. org.eclipse.osgiorg.eclipse.core.runtime

10 Eclipse Platform Architecture(2) core plugin Model  Workspace(Model)  Resource  Project  File  SWT  JFace View  Workbench(View)  View  Editor  Perspectives  Wizards  Action Sets

11 Eclipse Platform Architecture(3) The JDT is implemented by a group of plugins,with the user interface in a UI plugin and the non-UI infrastructure in a separate core plugin.

12 Eclipse Plugin Plugin structured  A plug-in is a structured component that contributes code (or documentation or both) to the system and describes it in a structured way. extension points extension manifest (plugin.xml) file  Plug-ins can define extension points, well-defined function points that can be extended by other plug-ins. When a plug-in contributes an implementation for an extension point, we say that it adds an extension to the platform. These extensions and extension points are declared in the plug-ins's manifest (plugin.xml) file. —— From Eclipse online Help

13 Eclipse Extension Model Define Extension Point Host Plugin Interface Extender Plugin Extension Class Implements extends looking up its extenders, instantiating the associated callback class, invoking the interface methods

14 Extension Model(con.) the extensibility of plugins by plugins Much like defining any contractual obligation:  an extension model provides a structured way for plugins to describe the ways they can be extended and for client plugins to describe the extensions they supply. Interface Schema

15 Extension Model(an example:popupMenus) org.eclipse.ui plugin extension point —— popupMenus CONFORMANCE RULE: Contributions must conform to expected interfaces. public class RunTestAction implements IObjectActionDelegate

16 Extension Model(an example:popupMenus)

17 Eclipse Extension Model Define Extension Point Host Plugin Interface Extender Plugin Extension Class Implements extends looking up its extenders, instantiating the associated callback class, invoking the interface methods

18 Extension Model(Extension Processing) In extension model,the host plugin is responsible for:  looking up  looking up its extenders  instaniating  instaniating the associated callback class  invoking  invoking the appropriate interface methods The extension declarations in all plugins that extend it must be processed.  Contributing to host plugin's UI  what callback objects to call

19 Extension Model(Extension Processing) Platform Runtime

20 Extension Model(Extension Processing) Contributing to host plugin's UI Code is not necessary!

21 Extension Model(Extension Processing) A principal function of extension processing is the instantiation and initializing of an extension's callback objects. instantiation: Actually,it is performed in a lazy manner initializing:

22 Plugin Runtime Considerations (Lazy Loading) LAZY LOADING RULE: LAZY LOADING RULE: needed  Contributions are only loaded when they are needed. declarative  This requires support for plugin declarative functionality.

23 Plugin Runtime Considerations (Lazy Loading) virtual proxy virtual proxy  may cache additional information about the real subject so that they can postpone accessing it. The Eclipse workbench populates a PluginAction from the information in the manifest (title, icon, tooltip). UI PluginAction loads the extension class and forwards the run() request to it. Action On Demand

24 Challenging Issues(1) Installing and updating  the ability to roll back,migrate existing program data and preferences,or ensure the installation is not corrupted  various providers => do not test fully Security  downloading from third parties (digitally signed)  controlling a plugin's access to other code and data (sandbox)

25 Challenging Issues(2) Concurrent plugin version support  confusing UI  versions are part of plugin dependency specifications  eclipse's solution: Generally,the latest version first. Scalability,up and down  too many plugins (fast start-up) features  install/update(changed,features)  scaling down(limited resources,minimal configuration)

26 Epilogue Motivations for Plugins What is platform-plugin architecture? Eclipse Example  platform  plugin  extension model Runtime consideration Some challenging issues

27


Download ppt "On Platform-Plugin Architecture Take Eclipse as an Example 魏恒峰."

Similar presentations


Ads by Google