1 / 49

eclipse – growing from a tools platform to an application platform

eclipse – growing from a tools platform to an application platform. Dr. Erich Gamma Eclipse Java Development Tools Lead/Eclipse PMC IBM Rational Software. overview. the eclipse component model generalizing the eclipse component model for rich client applications eclipse components in action

howell
Télécharger la présentation

eclipse – growing from a tools platform to an application platform

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. eclipse – growing from a tools platform to an application platform Dr. Erich Gamma Eclipse Java Development Tools Lead/Eclipse PMC IBM Rational Software

  2. overview • the eclipse component model • generalizing the eclipse component model forrich client applications • eclipse components in action • towards eclipse 3.1

  3. how eclipse started? • eclipse • an extensible tools platform • out-of-box function and quality toattract developers • a development environment for itself(Java IDE, PDE) • products by some major tool vendors • open-source and supports open source development “Eclipse is a kind of universal tool platform – an open extensible IDE for anything and nothing in particular.” PDE JDT Platform Java VM

  4. eclipse for non IDE applications “could I dump all the plug-ins that come with eclipse and use the platform to host only business specific plug-ins that have been built?” – news.eclipse.org But when using Eclipse 2.1 as an ordinary application platform you get either: • too much • all the IDE specific components • user interface is polluted with IDE specific actions • too little • only SWT and JFace • low level programming model • No extensibility

  5. how eclipse was used in 2.1 as well… • GDF Suite – a geographical information system to manage maps

  6. Towards a Rich Client Platform • Many workbench components are not IDE specific.Advanced desktop applications have similar needs • open architecture • efficient, configurable, portable user interface • supports product branding, install/update support • integrated help, user configuration/preferences • Enable workbench to be used for non IDE applications • remove IDE personality from workbench • no built-in editors, views, perspectives • remove assumption that workspace is the data model • make most other components optional • rich function, low footprint

  7. What is a Rich Client Application? • An application that use the windowing and GUI features of the operation system they run on. This means: • Native widgets, menu and tool bars • Drag & Drop • Integrates with platform component model • …

  8. Eclipse Rich Client Platform A Rich Client Platform needs a strong component model with the following major characteristics: • Specified interfaces: a component must declare its public API and how it can be extended • Lazy loading: components are loaded on demand not on startup • Versioning: prerequisite components are reference by name and version • Dynamic detection: components are detected dynamically (no need to restart) Additionally the following issues must be addressed: • Managing: install, update, remove & discover components • Development: IDE to develop components • Security: based on Java 2 security

  9. platform an extensible platform “everything is a plug-in” extensible IDE plug-ins plug-ins IDE run-time

  10. what is a plug-in? plug-in • plug-in= component • set of contributions • smallest unit of eclipse functionality • details spelled out in plug-in manifest • large example: mail client • small example: spam filter • extension point • named entity for collecting contributions • example: extension point to add spam filters • extension–a contribution • example: a specific spam filter • runtime – controls and manages contributions plug-in plug-in runtime extension extension point

  11. plug-in identification required plug-ins plug-in code declare contributionsthis plug-in makes define new extension point the plug-in manifest <pluginid= “com.example.tool.mail" name= “Example Mail Plug-in“ version= “1.0.0“ class= "com.example.tool.MailPlugin"> <requires> <import plugin= "org.eclipse.ui"version="3.0.0"/> </requires> <runtime> <library name= "mail.jar"> <export name= ”*"/> </library> </runtime> <extension point= "org.eclipse.ui.views"> <view id= "MailView" name= "Mail View" class= "com.example.tool.mail.MailView"/> </extension> <extension-point name= "spamFilters"id= "com.example.tool.mail.spamFilters"/> </plugin>

  12. extension configuration in XML <extension-point name=“Example" id=“example“ schema="schema/example.exsd"/> <extension point="org.eclipse.ui.preferencepages"> <page id=“com.example.myprefpage" icon="icons/image.gif" title=“My title" class=“com.example.mywizard"> </page> </extension> </plugin> extension point definition extension contribution

  13. what is the eclipse runtime? • Java component (plug-in) model • dependency management • activation management • classloaders • extension registry manages • extension points • corresponding extensions • OSGI based • open services gateway initiative • Nokia, NTT, Motorola, Philips, Siemens, Oracle • dynamic install / uninstall / update of bundles (= plug-ins) requires SMTP requires mail tool resources requires requires UI requires

  14. lazy loading <action toolbarPath=“search" toolTip=“Open Type” icon="icons/opentype.gif" class="org.eclipse.jdt.OpenTypeAction"/> lazily instantiated using reflection org/eclipse/jdt/OpenTypeAction.class contribution implementation

  15. developing and deploying plug-ins • plug-in development environment (PDE) • specialized tools for developing eclipse plug-ins • e.g. editor for plug-in manifest files • templates for new plug-ins • implemented as plug-ins atop eclipse platform and JDT • PDE runs and debugs another eclipse application • features group plug-ins into installable chunks • features downloadable from url addressable location • obtain and install new or update existing plug-ins

  16. advanced plug-in mechanism: fragments • plug-in fragments holds some of plug-in’s files • separately installable • each fragment has separate subdirectory • separate manifest file • logical plug-in = base plug-in + fragments • plug-in fragments used for • isolation of OS dependencies • internationalization – fragments hold translations • ship translations after the product was released • implementing backward compatibility support • reviving deleted API methods

  17. ready to use; easy to adopt • component model • simple but consistent • plug-ins have to be easy to develop  tool support • Java Development Tools (JDT) + Plug-in development environment (PDE) • scale-up to thousands of installed plug-ins • the problem is start-up time • lazy loading • plug-ins have to be easy to manage and discover • install, update, disable • built-in install/update support

  18. old architecture (eclipse platform 2.1.x) Help Update Compare Debug Search Team/ CVS UI Text Editors IDE Views Workbench (with IDE personality) primary application JFace Resources SWT Runtime

  19. towards a generic workbench • many workbench components are not ide specific;advanced desktop applications have similar needs • open architecture • efficient, configurable, portable ui • supports product branding, install/update support • integrated help, user configuration/preferences • enable workbench to be used for non-ide applications • remove assumption that workspace is the data model • remove ide personality from workbench • no built-in editors, views, perspectives • make most other components optional • rich function, low footprint

  20. old architecture (eclipse platform 2.1.x) Help Update Compare Debug Search Team/ CVS UI Text Editors IDE Views Workbench (with IDE personality) primary application JFace Resources SWT Runtime

  21. new architecture (eclipse 3.0) Help (optional) Update (optional) Text (optional) IDE Text Compare Debug Search Team/ CVS primary application IDE (optional) IDE Views Generic Workbench Resources (optional) JFace SWT Runtime (OSGi)

  22. a new runtime • Workbench runs on OSGI • open services gateway initiative: www.osgi.org • broad support by industry • Supports: dynamic install/uninstall/update of bundles • Workbench is now “dynamic aware”: • Reacts to plug-ins getting installed and uninstalled dynamically. • Adds/removes perspectives, views, action sets, etc., updating UI accordingly. • Provides event listeners for downstream plug-ins to react to Workbench changes in turn.

  23. eclipse 3.0 rich client platform • strong component model • specified interfaces: a component must declare istpublic API and extension points • lazy loading: components are loaded on demand • versioning: components must have versions • dynamic detection: components are detected dynamically(no need to restart) • security: based on Java 2 security • standards based: OSGI • compatible with 2.1 plugin model via compatibility layer

  24. eclipse components in action: hp35

  25. example overview • create a ‘classic’ plug-in • contribute to eclipse extension points • add pre-requisite plug-ins as needed • turn it into custom eclipse application • implement IPlatformRunnable • contribute to org.eclipse.core.runtime.applications • configure the workbench window (customize WorkbenchAdvisor) • enable/disable workbench features • define the initial perspective (implement IPerspectiveFactory) • fill the menu and toolbar • launch the workbench with your custom application • specify application id • define new extension point and extend • load plug-in dynamically

  26. hp35 contributes extension implements HP35View calls creates using reflection contributing an extension org.eclipse.ui extensionpoint views • plug-in org.eclipse.ui • declares extension point org.eclipse.ui.views • declares interface IViewPart • plug-in hp35 • implements interface IViewPart with its own class HP35View • contributes class HP35View to extension point IViewPart • plug-in org.eclipse.ui instantiates HP35View and calls its methods via interface IViewPart IViewPart

  27. contributing an extension • contributing a view <extension point="org.eclipse.ui.views"> <category name="Accessories“ id="HP35“/> <view name="HP35“ icon="icons/calculator.jpg“ category="HP35“ class="HP35.HP35View“/> </extension> ViewPart createPartControl() addOperator() HP35ViewPart createPartControl()

  28. define an eclipse application • we can run our contributions using the standard eclipse application • our contributions shows-up as part of the standard eclipse workbench • define a custom entry point • everything is a contribution …even the entry point into the eclipse platform <extension id="application" point="org.eclipse.core.runtime.applications"> <application> <run class="HP35App.HPApplication“/> </application> </extension> IPlatformRunnable run(Object args) HPApplication

  29. configuring the workbench window • WorkbenchAdvisor • a strategy object to configure a workbench window • provides hook methods called at strategic points during the workbench life cycle • defines the initial perspective PlatformUI createAndRunWorkbench() <<parameter>> WorkbenchAdvisor preStartup() postStartup() preWindowOpen() postWindowOpen() postShutdown() postShutedown() fillActionBars() getInitialPerspective()

  30. a minimal WorkbenchWindow class MinimalAdvisor extends WorkbenchAdvisor { public void preWindowOpen(IWorkbenchWindowConfigurer configurer) { super.preWindowOpen(configurer); configurer.setShowCoolBar(false); configurer.setShowMenuBar(false); } public void postWindowOpen(IWorkbenchWindowConfigurer configurer) { super.postWindowOpen(configurer); configurer.setTitle("HP35"); } public String getInitialWindowPerspectiveId() { return "hp35.hp35Perspective"; } }

  31. defining the perspective layout • contribute a perspective factory • hide the editor area <extension point="org.eclipse.ui.perspectives"> <perspective name="HP35App" class="HP35App.HP35AppPerspectiveFactory" id="hp35.hp35Perspective"> </perspective> </extension> public class HP35AppPerspectiveFactory implements IPerspectiveFactory { public void createInitialLayout(IPageLayout layout) { String editors= layout.getEditorArea(); layout.addView("HP35.views.HP35View", IPageLayout.TOP, 1.00f, editors); layout.setEditorAreaVisible(false); } }

  32. the application • run the workbench with the advisor • launch the application with your contributed application public class Application implements IPlatformRunnable { public Object run(Object args) throws Exception { WorkbenchAdvisor wa = new MinimalAdvisor(); Display d= PlatformUI.createDisplay(); int code= PlatformUI.createAndRunWorkbench(d, wa); return new Integer(code); } } java -cp startup.jar org.eclipse.core.launcher.Main -application HP35App.application

  33. …you are not done • … before you have thought about extensions • support to contribute new operators • define new extension point operators • “eat your own … extension points” • contribute hard-coded operators as extensions<extension point="HP35.operators"> <op name="+” class="HP35.HP35View$AddOp”/><extension point="HP35.operators"> <op name="-” class="HP35.HP35View$SubOp”/>

  34. dynamic extensions • track extensions from dynamically installed plug-ins private void addRegistryListener() { Platform.getExtensionRegistry().addRegistryChangeListener( new IRegistryChangeListener() { public void registryChanged(IRegistryChangeEvent event) { processRegistryDelta(event.getExtensionDeltas()); } }); } private void processRegistryDelta(IExtensionDelta[] deltas) { for (int i= 0; i < deltas.length; i++) { IExtensionDelta delta= deltas[i]; if (delta.getExtensionPoint().getUniqueIdentifier(). equals(“HP35.operators”)) { // process new extension } } }

  35. summary • applications inherit the technical characteristics of eclipse • cross platform • sophisticated, secure component system • rich UI widget set based on native widgets • rich UI framework • application metaphor • wizards, preferences, properties • perspectives, views, editors, workbench • help system • update system

  36. Eclipse 3.0 RCP Example: IBM workplace client

  37. eclipse trader

  38. summary (cont’d) • new Eclipse 3.0 runtime • based on OSGi • enables many RCP scenarios • backward compatible • Eclipse perception “Eclipse is a general application platform” “Eclipse is a general tooling platform” “Eclipse is a Java IDE” • Broader application improves the platform

  39. references • RCP UI page:http://www.eclipse.org/platform > UI > Proposals > Rich Client Platform • Ed Burnette’s RCP tutorials • platform newsgroup:news://news.eclipse.org/eclipse.platform • Gamma, Beck: Contributing to Eclipse – Principles, Patterns, and Plug-ins, Addison-Wesley, 2004www.awprofessional.com/series/eclipse

  40. status… 2005 Q3 Q4 Q1 Q2 3.0 3.1 M1 M2 M1 M3 M2 M4 M3 M4 M5 M5 M7 M6 M6 Linz 2004

  41. looking back to 3.0 "todo" 1,085 356 integration builds 4 new looks 9 milestones 9658 source files 8 responsive feedback UIs 1,903,219 LOC 21,332 JUnit tests 11,772 bugs fixed 47,427 posts to newsgroups 14,656 smoked cigarettes 195 comments for a single bug http://www.eclipse.org/eclipse/development/eclipse_3_0_stats.html

  42. eclipse platform 3.1 themes • Built to last • Simple to use • Rich client platform • J2SE 5 support • Large-scale development • Broadening the community • Draft plan on http://www.eclipse.org/eclipse/development/eclipse_project_plan_3_1.html

  43. built to last • Innovation with continuity  API stability • Performance dashboard • Leverage ground work laid in 3.0 • Continuous performance work

  44. simple to use • Instrumentation as a data collection mechanism • there is an instrumentation plug-in • Key bindings • Perspective dragging • JDT • lots of new quick assists • Capabilities to the next level • Role switcher • More trigger points • Preferences

  45. rich client platform • RCP apps explosion… Link to RCP page • Tools • Creation of RCP application • Deployment

  46. J2SE 5.0 – from cheetah to tiger • R3.0/cheetah04 • compiler: enhanced for, some generics • R3.1/milestone 1 • covariance • generics can be reconciled by model • R3.1/milestone 2 • generics everywhere (code-assist, search, format, DOM) • hex float literal • R3.1/milestone 3 • static imports, varargs, enumerations • JCK coverage > 97.71% • Next • annotations, auto-boxing • bug fixing / tuning

  47. J2SE 5.0 – tooling • Augment raw container types • Search for template instances • Convert to enhanced for-loops • Enumerations

  48. large-scale development • Working in large workspaces • Reified working sets in the package explorer • Grouping of breakpoints • Settings • Shared settings per project • Architectural access restrictions • NLS • Hovering • linking • Team policies • Mapping logical resources

More Related