eclipse more than a java ide [email protected] core / equinox committer users extenders...

38
Eclipse more than a Java IDE [email protected] [email protected] Core / Equinox Committer Core / Equinox Committer Users Extenders Publishers Enablers Configurers

Upload: evelyn-powers

Post on 30-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Eclipsemore than a Java IDE

[email protected][email protected]

Core / Equinox CommitterCore / Equinox CommitterUsers

ExtendersPublishers

EnablersConfigurers

What is Eclipse?

What is Eclipse?

“Eclipse is a kind of universal tool platform - an open extensible IDE for anything and nothing in particular.”

Eclipse is more than a Java IDE…

““In many ways Eclipse is the Emacs for the 21st century.” – In many ways Eclipse is the Emacs for the 21st century.” – Martin Fowler Martin Fowler

More than a Java IDESome Eclipse-based Open Source Projects

■ LanguagesLanguages– C/C++ – C#C#– PythonPython– PhpPhp– Cobol– Several UMLSeveral UML

■ Programming ToolsProgramming Tools– Graphical Editing Framework (GEF)– AspectJ tools– Modeling (EMF)– ANTLR Parser GeneratorANTLR Parser Generator– Several DB toolsSeveral DB tools– Jalopy Java Source Code Formatter Jalopy Java Source Code Formatter – Japple – RADJapple – RAD– Jasper report designerJasper report designer– LombozLomboz– Java SpiderJava Spider

■ Source & configuration mgt.Source & configuration mgt.– PerforcePerforce– Microsoft VSS PluginMicrosoft VSS Plugin– StellationStellation– ClearcaseClearcase

■ Web developmentWeb development– Sysdeo - Eclipse Tomcat Launcher Sysdeo - Eclipse Tomcat Launcher – WebLogic managerWebLogic manager– Several StrutsSeveral Struts– Spindle for TapestrySpindle for Tapestry

■ Testing / PerformanceTesting / Performance– Hyades– Resin PluginResin Plugin– MockCreator MockCreator – Solex Solex

http://www.eclipse.org/community/plugins.html

Eclipse Organization■ Eclipse ProjectEclipse Project the platformthe platform

– PlatformPlatform– JDT: Java Development ToolsJDT: Java Development Tools– PDE: Plug-in Development EnvironmentPDE: Plug-in Development Environment

■ Eclipse Tools Eclipse Tools product ready additions to the platformproduct ready additions to the platform– GEF: Graphical Editing FrameworkGEF: Graphical Editing Framework– CDT: C/C++ development toolsCDT: C/C++ development tools– EMF: Modeling FrameworkEMF: Modeling Framework– CobolCobol– VE: Visual editor for Swing (and SWT)VE: Visual editor for Swing (and SWT)– UML2: UML meta-model implementationUML2: UML meta-model implementation

■ Web-ToolsWeb-Tools web development supportweb development support– JSP and XML supportJSP and XML support– ……

■ Technology Technology experimental / research effortsexperimental / research efforts– ECESIS: Eclipse CoursewareECESIS: Eclipse Courseware– Equinox: new more dynamic plug-in architectureEquinox: new more dynamic plug-in architecture– ……

new

What is Eclipse?

Java VM

Platform

JDT

PDE

■ Eclipse is a universal platform for integrating Eclipse is a universal platform for integrating development toolsdevelopment tools

■ Open, Open, extensible architecture based on plug-insextensible architecture based on plug-ins

SDK

Resources, Team, Debug, Help, Update, SWT, UI,…

Compiler, Refactoring, JDT UI, JDT Debug,…

PDE Core, PDE Build, PDE UI

Platform vs. Extensible IDE

PlatformPlatform Extensible IDEExtensible IDE

IDE

Plug-ins

» Eclipse is a platform with a small runtime kernel

Runtime

Plug-ins

Eclipse Plug-in Architecture

■ Plug-in Plug-in – set of contributions– set of contributions– Smallest unit of Eclipse Smallest unit of Eclipse

functionalityfunctionality

■ Extension point Extension point – named entity – named entity for collecting contributionsfor collecting contributions– Example: extension point for Example: extension point for

adding software metricsadding software metrics

■ Extension Extension –– a contributiona contribution– Example: a specific metricExample: a specific metric

Plug-in

Platform

Plug-in

ExtensionExtension point

Extension configuration in XML

<plugin id=“org.eclipse.ui”> <extension-point name=“Prefs" id=“preferencepages“ schema="schema/prefs.exsd"/> …</plugin>

<plugin id=“myPlugin”> <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 contribution

Extension point definition

Plug-in Goals…

■ Easy to developEasy to develop– Java Development Tools + Plug-in development environmentJava Development Tools + Plug-in development environment

■ Scale-up to hundreds of installed plug-insScale-up to hundreds of installed plug-ins– the problem is start-up time… the problem is start-up time… – Eclipse consists of 80 plug-ins, WSAD IE is even larger > 1500 Eclipse consists of 80 plug-ins, WSAD IE is even larger > 1500

plug-insplug-ins lazy loadinglazy loading

■ Easy to discover, install, and updateEasy to discover, install, and update– install/update supportinstall/update support

■ Easy to manage an installationEasy to manage an installation– managed configurations managed configurations

Eclipse Involvements

■ UsersUsers– Users of EclipseUsers of Eclipse

■ ConfigurersConfigurers– Adapt Eclipse to their personal needs by choosing and Adapt Eclipse to their personal needs by choosing and

installing plug-ins and customizing them in anticipated installing plug-ins and customizing them in anticipated waysways

■ ExtendersExtenders– Provide extensions to existing extension pointsProvide extensions to existing extension points

■ PublishersPublishers– Extenders who make their extensions available using the Extenders who make their extensions available using the

Eclipse mechanismsEclipse mechanisms

■ EnablersEnablers– Providers of extension pointsProviders of extension points

The Contribution Cycle

Users

ExtendersPublishers

EnablersConfigurers

Extender: Contribute an Icon View

■ Goal: a plug-in to view the standard Eclipse imagesGoal: a plug-in to view the standard Eclipse images■ Steps:Steps:

– read extension point specificationsread extension point specifications– use Plug-in Development Tools to create a plug-in use Plug-in Development Tools to create a plug-in

project and to declare the extensionproject and to declare the extension– use the Java Development Tools to implement the use the Java Development Tools to implement the

extensionextension

House Keeping Rules for Extenders *

■ Program To API Contract Rule: Check and program to the Eclipse API contract

■ Sharing RuleSharing Rule: Add, don’t replace: Add, don’t replace

■ Responsibility RuleResponsibility Rule: Clearly identify your plug-in as the source of : Clearly identify your plug-in as the source of problemsproblems

■ Strata Rule: Separate language-neutral functionality from language-specific functionality and separate core functionality from UI functionality

■ Conformance RuleConformance Rule: Contributions must conform to expected : Contributions must conform to expected interfacesinterfaces

*Erich Gamma, Kent Beck - Contributing to Eclipse: Practices, Plug-Ins, Patterns

The Contribution Cycle

Users

Extenders Publishers

EnablersConfigurers

Publisher: Install/Update

■ FeaturesFeatures group plug-ins into installable chunks group plug-ins into installable chunks– Feature manifest fileFeature manifest file

■ Plug-ins and features bear version identifiersPlug-ins and features bear version identifiers– major . minor . Service . qualifiermajor . minor . Service . qualifier– Multiple versions may co-exist on diskMultiple versions may co-exist on disk

■ Features downloadable from web siteFeatures downloadable from web site– Using Eclipse Platform update managerUsing Eclipse Platform update manager– Obtain and install new plug-insObtain and install new plug-ins– Obtain and install updates to existing plug-insObtain and install updates to existing plug-ins

Publisher: Create a Feature

■ Feature describesFeature describes– Contained plug-ins and their versionsContained plug-ins and their versions– Pre-requisite plug-ins for the featurePre-requisite plug-ins for the feature

<feature id="org.demo.imageviewfeature“ version="1.0.0"> <requires> <import plugin="org.eclipse.core.resources"/> <import plugin="org.eclipse.ui"/> </requires> <plugin id="org.demo.imageview" download-size="0" install-size="0" version="1.0.0"/></feature>

Publisher: Create an Update Site

■ An update-site An update-site – is any URL addressable locationis any URL addressable location– contains zips for the feature and plug-ins contains zips for the feature and plug-ins – version information encoded in the zip nameversion information encoded in the zip name– contents described by a site.xml filecontents described by a site.xml file

<site> <feature url="features/org.demo.imageview_1.0.3.jar“> <category name=“demos" /> </feature> <category-def name=“demos" label=“Demo Plugins"> <description>Eclipse Demo Plugins</description> </category-def></site>

House Keeping Rules for Publishers

■ License Rule: Always supply a license with every contribution.

The Contribution Cycle

Users

Extenders Publishers

EnablersConfigurers

Enabler: Invite Others to Contribute

extension-pointimageFilters

■ Declares extension point: <extension-point id=“imageFilters”/>

■ Declares interface: interface IImageFilter {

Image filter(Image image); }

interface IImageFilter

calls

ImageViewer Plugin

Enabler: Invite Others to Contribute

My Plug-in

class GreyFilter

extension-pointimageFilters

extensioncontributes

■ Declares extension point: <extension-point id=“imageFilters”/>

■ Declares interface: interface IImageFilter {

Image filter(Image image); }

■ Contributes extension: <extension point=“….imageFilters”/> …class=“GreyFilter”</extension>

■ Implements interface: class GreyFilter implements IImageFilter {}

interface IImageFilter

calls

implements

ImageViewer Plugin

Enabler: Invite Others to Contribute

My Plug-in

class GreyFilter

extension-pointimageFilters

extensioncontributes

■ Declares extension point: <extension-point id=“imageFilters”/>

■ Declares interface: interface IImageFilter {

Image filter(Image image); }

■ Contributes extension: <extension point=“….imageFilters”/> …class=“GreyFilter”</extension>

■ Implements interface: class GreyFilter implements IImageFilter {}

interface IImageFilter

Instantiated via reflectioncalls

implements

ImageViewer Plugin

uses

House Keeping Rules for Enablers

■ Invitation RuleInvitation Rule: Whenever possible, let others contribute to your : Whenever possible, let others contribute to your contributionscontributions

■ Explicit API Rule: Separate the API from internals

■ Fair Play RuleFair Play Rule: All clients play by the same rules, even me.: All clients play by the same rules, even me.

■ Diversity Rule: Extension points accept multiple extensions.

■ Lazy Loading RuleLazy Loading Rule: Contributions are only loaded when they are : Contributions are only loaded when they are neededneeded

■ Good Fences Rule: When passing control outside your code, protect yourself

■ Stability RuleStability Rule: Once you invite someone to contribute, don’t change : Once you invite someone to contribute, don’t change the rulesthe rules

Closing the Circle■ Now that we have published a plugin with extension Now that we have published a plugin with extension

points we have closed the circle:points we have closed the circle:

Extenders can now extend your extensions!Extenders can now extend your extensions!

Users

Extenders Publishers

Enablers Configurers

Summary

■ All functionality is provided by plug-ins and All functionality is provided by plug-ins and fragmentsfragments– Includes all aspects of Eclipse Platform itselfIncludes all aspects of Eclipse Platform itself

■ Contributions are made via extension pointsContributions are made via extension points– Extensions are created lazilyExtensions are created lazily

■ Plug-ins are packaged into separately installable Plug-ins are packaged into separately installable featuresfeatures– DownloadableDownloadable

What’s Next: Beyond Java Stuff

Eclipse

Rich ClientPlatform

Eclipse Web Project

Open-up Java Tooling

Eclipse 3.0 Themes

■ PlatformPlatform– improved user experienceimproved user experience

• UI scalability in the face of tons of contributionsUI scalability in the face of tons of contributions• Out of the box experienceOut of the box experience• New look and feelNew look and feel

– responsive UIresponsive UI• background activitiesbackground activities

– rich client platformrich client platform• generalize Eclipse into a platform for building non-IDE appsgeneralize Eclipse into a platform for building non-IDE apps

– dynamic runtimedynamic runtime

■ Java Development ToolsJava Development Tools– open-up for other Java family members (edition, index, refactoring)open-up for other Java family members (edition, index, refactoring)– improved user experienceimproved user experience

• navigationnavigation– digesting Tiger (jdk 1.5)digesting Tiger (jdk 1.5)

What is Eclipse RCP ?

“Eclipse is a kind of universal tool platform – an open extensible IDE for anything

and nothing in particular. “

Eclipse is more than a Java IDE…

What is Eclipse RCP?

Java VM – ee.minimum

Platform

■ A refactoring of the platformA refactoring of the platform

SDK

IDE Specific Platform

JDT

PDE

Runtime, Help, Update, SWT, Generic UI,…

Resources, Team, Debug,IDE UI,…

Dynamic runtime

■ Dynamic plug-inDynamic plug-in– Addition of plug-insAddition of plug-ins– Removal of plug-ins (no magic, instances need to be freed)Removal of plug-ins (no magic, instances need to be freed)– Update of plug-insUpdate of plug-ins

OSGi runtime (www.osgi.org)OSGi runtime (www.osgi.org)– Standardized runtimeStandardized runtime– Improved class-loadingImproved class-loading– Finer grained management of plug-in dependenciesFiner grained management of plug-in dependencies– Smaller JDK required, embedded devicesSmaller JDK required, embedded devices

Why not Eclipse in your cell phone or palm?

The Way to Eclipse

1999 20032000 2001 2002

Eclipse

19981997

NovOpen Sourceannouncement

VisualAge/Java

VisualAge Micro edition

March 2.1

Oct1.0

June 2.0

June Tech Preview

Eclipse Supports Plug-in Development

Platform Runtime

Workspace

Help

Team

Workbench

JFace

SWT

Eclipse Project

JavaDevelopment

Tools(JDT)

Their Tool

Your Tool

AnotherTool

Plug-inDevelopmentEnvironment

(PDE)

Eclipse Platform

Debug

UpdateUpdate

Monkey See/Monkey Do

■ Eclipse TrioEclipse Trio– toolstools– published APIspublished APIs– Open Source Open Source → source access→ source access

■ Learn-by-exampleLearn-by-example– browse existing codebrowse existing code– PDEPDE– JSpiderJSpider

Extending Eclipse for Fun and Profit…

Eclipse SDK

IBM Websphere Studio App.

Developer

Eclipse SDK

SAPNetWeaver Developer Studio

Commercial Development Environments

Commercial Add-Ons

Eclipse SDK

IBM Websphere Studio App.

Developer

Eclipse SDK

SAPNetWeaver Developer Studio

Instantiations, Borland, Sitraka, SlickEdit…

Platform Implications

Everybody can contribute plug-insEverybody can contribute plug-ins– Every programmer can be a Every programmer can be a tool smithtool smith

Creating opportunities for further extension makes Creating opportunities for further extension makes it possible for the tool smith to benefit from the it possible for the tool smith to benefit from the work of otherswork of others

It has to be easy to install and manage plug-insIt has to be easy to install and manage plug-ins

Tip of iceberg

Implementationof plug-in contributions

Declarative definitionof plug-in contributions

startup time: O(#used plug-ins), not O(# installed plug-ins)