350 likes | 657 Views
Eclipse. Paolo Gasti. The Problem. There is the need for a new development environment It has to help software designers and implementers to do their jobs faster and easier There are so many approaches to software development that no tool can be the solution
E N D
Eclipse Paolo Gasti
The Problem • There is the need for a new development environment • It has to help software designers and implementers to do their jobs faster and easier • There are so many approaches to software development that no tool can be thesolution • We need to fill the blank left by tools such as Emacs
What is Eclipse? “Eclipse is a kind of universal tool platform – an open extensible IDE for anything and nothing in particular.” – eclipse.org Eclipse is more than a Java IDE… “In many ways Eclipse is the Emacs for the 21st century.” – Martin Fowler
The Way to Eclipse 2003 1997 1998 1999 2000 2001 2002 VisualAge/Java VisualAge Micro edition Eclipse March v. 2.1 June Tech Preview Oct v. 1.0 June v.2.0 Nov Open Source announcement
Design Goals • Provide an open platform for the construction of tools for application development • Support an unrestricted set of tool providers • Support tools to manipulate arbitrary content types (language neutral) • Seamless integration of tools within and across different content types and tool providers • Availability on a wide range of platforms
Plug-in Architecture Goals • Easy to develop • Java Development Tools + Plug-in development environment • Scale-up to hundreds of installed plug-ins • It tries to reduce start-up time • Out-of-the-shelf Eclipse consists of 80 plug-ins • Lazy loading • Easy to discover, install, and update • install/update support • Easy to manage an installation • managed configurations
Why Open Source • Many partners can contribute during all the life cycle of a tool • It provides less dependency on a single vendor • Every partner can implement its own product without the need to stipulate any contract with IBM • The community can • provide feedback to the developers • submit patches • answering user’s questions
Implications • Vendors can concentrate on their own special area of expertise providing higher value • Improved integration of tools from multiple vendors • The interface can be customized to fit any function, format or style • Plug-ins can be free or commercial • A flourishing business gravitates around Eclipse (WebSphere etc…)
Eclipse Architecture • Plug-in, the smallest unit of Eclipse function • Eclipse is a platform with a small runtime Kernel and several layers of plug-in built on it • Everybody can be a tool smith • SWT (Standard Widget Toolkit) offers significant advantages over AWT and Swing Platform Extensible IDE Plug-ins Plug-ins IDE Runtime
Java VM JDT PDE Platform Eclipse Architecture PDE Core, PDE Build, PDE UI SDK Compiler, Refactoring, JDT UI, JDT Debug,… Resources, Team, Debug, Help, Update, SWT, UI,…
Eclipse Architecture Another Tool Eclipse Platform Help Workbench Java Development Toolkit (JDT) JFace Team SWT Your Tool Debug Plug-in Development Environment (PDE) Workspace Update Their Tool Platform Runtime Eclipse Project
Eclipse Platform Start Up • Eclipse Platform Runtime handles start up • Discovers plug-ins installed on disk • Matches up extensions with extension points • Builds global plug-in registry • Caches registry on disk for next time
Eclipse Platform • The Platform is divided into components • The standard components, provided with the installation file freely downloadable from eclipse.org, are • Ant – Universal Compare • Core – Release Engineering • Platform CVS Integration – Debug framework • Platform help system – Text editor framework • Support for Platform scripting – Platform user interface • Integrated search facility – WebDAV integration • SWT (Standard Widget Toolkit) – Generic Team support • Dynamic Update/Install Service
Plug-in Architecture • Extension point- named entity for collecting “contributions” • Extension - a contribution • Each plug-in • Contributes to 1 or more extension points • Optionally declares new extension points – programmers can extend good plug-ins to fit their needs • Depends on a set of other plug-ins • Contains Java code libraries and other files • Details spelled out in the plug-in manifest • Manifest declares contributions • Code implements contributions and provides API
Extension Points Principles • Let others contribute to your contributions • Lazy loading rule: load extensions only when they are about to be called • Contributions do not • override existing behavior • remove or replace existing component • harm existing or future contributions
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 point definition Extension contribution
Plug-in identification Other plug-ins needed Location of plug-in’s code Declare contributionthis plug-in makes Declare new extension point open to contributions from other plug-ins Plug-in Manifest <plugin id = “com.example.tool“ version = “2.1.0” name = “Example Plug-in Tool" class = "com.example.tool.ToolPlugin"> <requires> <import plugin = "org.eclipse.core.resources“ version=“2.0.0”/> <import plugin = "org.eclipse.ui“ version = “2.0.1”/> </requires> <runtime> <library name = “tool.jar"/> </runtime> <extension point = "org.eclipse.ui.preferencepages"> <page id = "com.example.tool.preferences" icon = "icons/knob.gif" title = “Tool Knobs" class = "com.example.tool.ToolPreferenceWizard“/> </extension> <extension-point name = “Frob Providers“ id = "com.example.tool.frobProvider"/> </plugin>
Contribution architecture My Plug-in ImageViewer Plugin extension-pointimageFilters contributes extension implements interface IImageFilter class GreyFilter calls • 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 {}
uses Contribution architecture My Plug-in ImageViewer Plugin contributes extension-pointimageFilters extension implements interface IImageFilter class GreyFilter calls Instantiated via reflection • 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 {}
Java Core requires requires Java UI requires Resources requires UI requires Plug-in Activation • Each plug-in gets its own Java class loader and has its own class path • Delegates class load requests to required plug-ins • Contributions processed without plug-in activation • Example: Menu constructed from manifest info for contributed items • Plug-ins are activated only as needed • When a class is loaded by the class loader • Scalable for large base of installed plug-ins
Languages C# C/C++ Python Cobol Php Several UML Programming Tools ANTLR Parser Generator Graphical Editing Framework (GEF) AspectJ tools Modeling (EMF) Several DB tools Jalopy Java Source Code Formatter Japple – RAD Jasper report designer Lomboz Java Spider Source & configuration mgt. Perforce Microsoft VSS Plug-in Clearcase Stellation Web development Sysdeo - Eclipse Tomcat Launcher WebLogic manager Several Struts Spindle for Tapestry Testing / Performance Resin Plug-in MockCreator Solex Hyades More than a Java IDEEclipse vs. NetBeans http://www.eclipse.org/community/plugins.html
The UML 2 plug-ins • There are several UML 2 compliant plug-ins • Most of them provide support for • Reverse-engineering of source code (often also from binaries) • Code generation • Code Synchronization • Code analysis • Documentation generation • Automatic diagram altering after code altering
Slime UML 2 plug-in • Guides the team through all the development process • It is very light-weight: only 1 MB
Refactoring Support • Refactoring is changing the structure of a program without changing its functionality • There are many reasons to do refactoring • The team of a project disappears and you need to add/improve the functionality of its (quite obscure) code • A new requirement is introduced because of a design mistake or an iterative approach (such as XP) • Once familiar with this tool, a programmer can generate code in the first place, then use it to conform its code to some standards (such as the use of getter/setter methods)
Refactoring Support • Eclipse provides three types of Refactoring • Physical organization and renaming • Logical organization at the class level • Change the code within a class
Physical organization and renaming • Avoid the need to edit many files to update import and package statements • Automatically checks the context, not only the names • Allows to automatically • Rename fields • Rename variables • Rename classes and interfaces • Move packages and classes
Logical organization at the class level • While not as useful as the other kind of refactorings, it allows to automatically • Turn anonymous classes into nested classes • Turn nested classes into top-level classes • Create interfaces from concrete classes • Move methods or fields from a class to a subclass or superclass
Change the code within a class • Allows you to automatically • Turn local variables into class fields • Turn selected code in a method into a separate method • Generate getter and setter methods for fields • Change method signature (doesn’t fit exactly here…)
Refactoring Support • The power of Eclipse’s refactoring capability is to allow an user to do a safe refactoring with some mouse clicks
Eclipse’s Cons • Windows-centric (ActiveX, OLE) • Slow and often unstable under Unix • Forces developers to use its own directory structure • Sun does not like it exists, having its own NetBeans (but Eclipse is supported by IBM…)
Case of Study: the JavaCard Plug-in • It offers the complete class library of the JavaCard platform • Allows developers to simulate IBM’s smart card hardware • Offers an advanced debugger • Lets Eclipse connect to real smart cards • Offer complex functionalities
Case of Study: the JavaCard Plug-in • Offers concrete advantages against the stand-alone version • The Java Editor provided with Eclipse is much better than the editor provided with JavaCard • Allows the developer to edit and test the code with the same interface • Can be used together with other tools such us an UML 2 plug-in • Shows the power of the Eclipse platform when developing highly specialized software
Summary • All functionality is provided by plug-ins and fragments • Includes all aspects of Eclipse Platform itself • Contributions are made via extension points • Extensions are created lazily • Plug-ins are packaged into separately installable features • Downloadable
Summary • Everybody can contribute plug-ins • Every programmer can be a tool smith • Creating opportunities for further extension makes it possible for the tool smith to benefit from the work of others • The same environment can be used to develop applications and to develop tools for itself
References • Refactoring For Everyone by IBM (http://www-106.ibm.com/developerworks/opensource/library/os-ecref/) • Eclipse Platform Technical Overview – eclipse.org • The Mathaino Project - Department of Computing Science, University of Alberta • Eclipse Platform on-line help • Omondo whitepaper – www.omondo.com • Eclipse.org plug-ins documentation - http://www.eclipse.org/community/plugins.html • OOPSLA 2003 documentation – www.oopsla.org