27 must-have eclipse...

44
Volume 1 Number 4 Fall 2006 www.eclipsereview.com A BZ Media Publication IMPROVING CODE WITH STATIC ANALYSIS Web 2.0! AJAX Meets JavaServer Faces SOAP? XML? WSDL? Java? Eclipse!! 27 M us t -Have Eclipse Plug-Ins 27 M us t -Have Eclipse Plug-Ins

Upload: others

Post on 10-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Volume 1 n Number 4Fall 2006

www.eclipsereview.com

A BZ Media Publication

IMPROVING CODE WITH STATIC ANALYSIS

Web 2.0!AJAX MeetsJavaServer Faces

SOAP? XML? WSDL?Java? Eclipse!!

27 Must-HaveEclipse Plug-Ins

27 Must-HaveEclipse Plug-Ins

Page 2: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

eCube Systems

Copyright eCube Systems LLCSan Mateo - Boston - Houston

Enabling Enterprise Evolution

NXTware™ ESBLegacy Modernization with...

Learn more about Enterprise Evolution andNXTware SOA for Eclipse. Call (866) 493-4224or visit www.ecubesystems.com.

Implementing XML and Service Oriented Architecture doesn’t mean starting from scratch. Why notintegrate and modernize application functions as you need them in Eclipse?

NXTware ESB provides just-in-time modernization from within an Eclipse development environment.Lower costs and reduce risk by creating SOA interfaces for the business functions you need, when youneed them, with NXTware ESB for Eclipse.

...another Eclipse plug-in you can’t live without.

Page 3: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

eCube Systems

Copyright eCube Systems LLCSan Mateo - Boston - Houston

Enabling Enterprise Evolution

NXTware™ ESBLegacy Modernization with...

Learn more about Enterprise Evolution andNXTware SOA for Eclipse. Call (866) 493-4224or visit www.ecubesystems.com.

Implementing XML and Service Oriented Architecture doesn’t mean starting from scratch. Why notintegrate and modernize application functions as you need them in Eclipse?

NXTware ESB provides just-in-time modernization from within an Eclipse development environment.Lower costs and reduce risk by creating SOA interfaces for the business functions you need, when youneed them, with NXTware ESB for Eclipse.

...another Eclipse plug-in you can’t live without.

Page 5: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

18 COVER STORY27 Must-Have EclipsePlug-InsRick Wayne takes you on a scenictour of his favorite add-ins, coveringlanaguage support, modeling, UIdesign, integration, frameworks andmuch more.

27 SOAP? XML? WSDL?Java? Eclipse!!You can leverage Web services usingthe Eclipse Web Tools Platform, asChrisopher Judd demonstrates.

32 Improving Code WithStatic AnalysisSteve Gütz teaches you how todefeat code defects by leveragingEclipse’s Test and Performance Tools Platform.

38 AJAX MeetsJavaServer FacesMax Katz shows how you can usecomponent-based development forbuilding “Web 2.0”–style richInternet applications.

Eclipse Review is published 4 times a year by BZ Media LLC, 7 High Street, Suite 407, Huntington, NY 11743. POSTMASTER: Send address changes to BZ Media, 7 High Street, Suite 407,Huntington, NY 11743. Ride along is included.

Copyright © 2006 BZ Media LLC. All rights reserved. Eclipse Review is a trademark of BZ Media LLC. Eclipse is a trademark of The Eclipse Foundation.

DEPARTMENTS

Vol. 1 n No. 4 n FALL 2006

BZ Media LLC | 7 High Street, Suite 407 | Huntington, NY 11743 | +1-631-421-4158 | fax +1-631-421-4130 | www.bzmedia.com | [email protected] | Ted Bahr Executive Vice President | Alan Zeichick

Cover Illustration: “Earth and Sky,” by Meg Gencay

FEATURES

7 ContextHappy birthday, Eclipse! It’s been five years, and lookhow much the platform and community have grown.

8 LaunchpadThe latest tools, technologies and plug-ins for Eclipsedevelopers.

10 FoundationGood news on adoption of the Rich Client Platform,and a first glance toward Europa.

11 ShoptalkWith Wolfram Workbench, Mathematica users gain asophisticated Eclipse-based IDE.

13 ProjectsThe Data Tools Platform makes it easy to work withrelational databases.

41 PerspectiveHas the open-source Eclipse platform ruined the commercial tools market—or helped it?

Page 6: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Sybase WorkSpace:Do Something More Interesting

Copyright © 2006 Sybase, Inc. All Rights Reserved. All product and company names are trademarks of their respective owners.

A SINGLE ENVIRONMENT OFFERS WHAT YOU NEEDSybase WorkSpace is a Java™ toolkit offering the five most importantdesign and development tools in an integrated easy-to-use, opensource framework:

• database development • mobile development• web application development • enterprise modeling • services-oriented development

MAKES DEVELOPMENT AND DESIGN EASY TO LEARN AND USEUsing industry-leading integrated model-driven design, visual develop-ment and task-based wizards, Sybase WorkSpace automates mundanetasks and cuts the typical development tool learning curve, freeingdevelopers to concentrate on what’s important—business logic.

FREEDOM TO CUSTOMIZE BASED ON YOUR BUSINESS NEEDS WorkSpace’s modular packaging allows enterprises the flexibility todecide how to assign business critical tasks to developers, rather thanrequiring them to fit into ill-fitting “roles” predetermined by a vendor.You buy only the pieces you need, enabling you to customize yourenvironment as you see fit.

With Sybase WorkSpace, you’re finally free to do the design anddevelopment that’s interesting to you. For more information andto download White Papers and an evaluation copy, visitwww.sybase.com/workspace

Sybase_WorkSpace_Ad.qxp 5/25/06 9:47 AM Page 1

Page 7: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Happy Birthday, Eclipse!

IBM’s commitment to Eclipse wasfurther demonstrated by its willingnessto divest itself of its intellectual proper-ty and form the independent EclipseFoundation in February 2004. Theunprecedented moves toward opensource and open governance launchedEclipse into orbit.

WHERE NO STANDARD IDE HAS GONE BEFORE…But that’s not what’s sustained it there.The Eclipse Foundation and its activemembers have continued to broadenthe platform’s charter. They’ve intro-duced Eclipse into new areas, goingwhere no standard IDE has gone before.To name just a few: The Rich ClientPlatform has taken on a life of its own.The C/C++ Development Tool projectshowed that a Java IDE doesn’t have tobe limited to just Java. The DeviceSoftware Development Platform helpedprogramming think inside the box, asdid the Embedded Rich Client Platform.

As Eclipse reaches its fifth year, theorganization has a number of fascinat-ing new projects that are either just set-ting sail or making progress. Some aremaking more progress than others, butthat’s what happens in a community.

One new project is COSMOS, whichextends the Eclipse platform outside ofsoftware development and into moregeneral IT: “The mission of the EclipseCOSMOS Project is to build generic,

extensible, standards-based componentsfor a tools platform upon which soft-ware developers can create specialized,differentiated and interoperable offer-ings of tools for system management.”That’s a new direction for theFoundation, driven by companies likeIBM, Cisco, Intel and Compuware.

Another advance is the Rich ServerPlatform User Interface Framework, orRSP-UI. (Gotta love those Eclipseacronyms!) This project is conceptuallysimilar to the Rich Client Platform,except that it allows the creation ofpluggable, componentized, server-sideapplications, where plug-ins communi-cate with each other through extensionpoints and OSGi services. This projecthasn’t made much progress lately, butthe concept is fascinating.

A more active project is theSubversive Project, which seeks to cre-ate a Subversion plug-in for Eclipsewith functionality similar to the EclipseCVS Team project. If the project is suc-cessful, the team hopes that Subversionsupport will become a core Eclipse fea-ture. Polarion Software, which sellsapplication life-cycle tools forSubversion, is running the project. Sofar, it’s on track for release in 2007.

The first five years of Eclipse havebeen exciting—look how far the tech-nology, and the organization, havecome in a short time. I can’t wait to seewhat happens next.

It’s been five years since IBM launched Eclipse asan open source project. The technology had beenincubating inside Big Blue since the late 1990s as anext-generation Java IDE, but IBM’s announcementthat it was open-sourcing Eclipse, on Nov. 7, 2001, setthe platform on the path to super-accelerated growth.Today, Eclipse is second only to Microsoft’s VisualStudio in adoption, surpassing Sun’s NetBeans andBorland’s JBuilder in the Java space.

CONTEXTFrom the Editor | by Alan Zeichick

EDITORIALEditorial DirectorAlan [email protected]

Copy EditorLaurie O’Connell

Contributing EditorGeorge [email protected]

ART & PRODUCTIONArt DirectorLuAnn T. Palazzo

Art/Production AssistantErin Broadhurst

SALES & MARKETINGPublisherTed Bahr+1-631-421-4158 [email protected]

Southwest U.S./AsiaRobin Nakamura [email protected]

Northwest U.S./CanadaPaula Miller [email protected]

Southeast U.S./EuropeJonathan Sawyer [email protected]

Northeast/Central U.S./CanadaDavid Lyman [email protected]

Advertising TrafficPhyllis Oakes +1-631-421-4158 [email protected]

Marketing ManagerMarilyn Daly +1-631-421-4158 [email protected]

List ServicesNyla Moshlak+1-631-421-4158 [email protected]

ReprintsLisa [email protected]

AccountingViena Isaray+1-631-421-4158 [email protected]

READER SERVICEDirector of CirculationAgnes Vanek+1-631-421-4158 [email protected]

Customer Service/Subscriptions+1-631-421-4158 [email protected]

BZ Media is an AssociateMember of the EclipseFoundation, www.eclipse.org

Fall 2006 www.eclipsereview.com | 7

Page 8: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

GWT Designer Delivers AJAXGUI for Google Web Tool

Instantiations is offering GWTDesigner, a new tool for AJAX Webapplications using the Google WebTool. GWT Designer is built onWindowBuilder Pro, the company’ssoftware for creating Java graphicaluser-interface applications for Linux,Mac OS X and Windows. GWTDesigner provides developers with arich WYSIWYG GUI construction envi-ronment. Developers simply drag-and-drop composites, layouts and controlswhen building user interfaces, whichcan be tested and deployed using theJava-to-JavaScript compiler providedby Google. GWT Designer alsoincludes bidirectional code generation,a WYSIWYG designer and CascadingStyle Sheet support. Its GWT applica-tion launch system has a shortcut forfast launching using the popup menuor editor hot key. It also has intelli-gent refactoring, where renaming ormoving a module class or remoteservice updates the module XML fileand renames any associated Asyncand Impl classes. The software costsUS$39 for an annual subscription.www.instantiations.com

Real-Time IDE for Enea’s OSELeverages Eclipse, CDT

Optima is a new Eclipse-based IDE forOSE, a time-time operating systemfrom Enea. Optima, which costs $3,000per seat, uses Eclipse 3.1.2 andC/C++ Development 3.1.1 to providesystem-level browsing, debugging, pro-filing and analysis tools for large-scaledistributed systems spanning multipleprocessors and operating systems.Optima uses the Eclipse Workbenchand Workspace concept for buildingimages and managing projects, andprovides plug-ins for most softwareconfiguration management tools. TheCDT includes a C/C++ editor withlanguage-aware highlighting and code

completion, a C/C++ debugger, aC/C++ launcher, a parser and index-er, a search engine, content assist anda Makefile editor and builder. Thecompany builds on Eclipse with severalOSE-aware plug-ins that help develop-ers solve complex system-level prob-lems in their application code. Theseplug-ins include a system browser forviewing and manipulating OSE systemobjects, a pool profiler for browsingand analyzing system memory utiliza-tion, a run-mode debugger with a pro-gram launcher (loader), and a helpviewer for viewing OSE documents andreferences. All Optima plug-ins supportfully distributed debugging, whichenables any target CPU in a connectednetwork to be accessed without theneed for a direct connection.www.enea.com

GUIdancer Tests WithoutCoding

GUIdancer is an Eclipse-based envi-ronment from Bredex for testingJava/Swing application GUIs that thecompany claims requires no coding.New in version 1.1, released lastweek, is the ability to execute batchtests from a command line, support fortesting multilingual applications usingthe same test components, new capa-bilities for trees and tables, and animproved user interface. First releasedin January as a preview, GUIdancer1.1 for Linux, Mac OS X, Solaris andWindows also now includes an API toextend the tool—without code—forapplications that use non-Java/Swingcomponents and actions. To avoid theneed for programming, GUIdanceremploys a so-called specification con-cept, which creates modular, reusabletests from source code before an appli-cation is completed. On the desktop,the program requires Java 1.5, whichis included with the Windows down-load. The server component runs onJava 1.3. Demo licenses are free;

named-user licenses costs €980, plus€245 of annual maintenance.www.guidancer.com

SHORT TAKESStylebase is a new open-source

tool for maintaining a reuse repositoryfor architectural models and designpatterns. The software and the reposi-tory assist developers in applying aquality-driven architecture design tosoftware engineering in a way thatpromotes software reuse. The tool canbe used in three ways: as an electron-ic library, where an architect canbrowse the stylebase as a pattern cat-alogue; for model evaluation; wherethe architect detects which patternshave been used in an architecturemodel and then checks from thestylebase which quality-attributes areassociated with these patterns; andfor constructing a new architecturemodel, where the architect searchesthe knowledge base according to thedesired quality characteristics.stylebase.sourceforge.net

GNATbench for Eclipse is a plug-in thatprovides editing, browsing and build-ing features for Ada (including Ada2005) development using AdaCore’sGNAT Pro toolset on the Eclipse plat-form. The builder produces executablesfor native systems and embeddedprocessors (in the context of WindRiver’s Workbench), and the debuggersupports both native and embeddedsystem debugging. GNATbenchincludes an Ada-specific editor, codeassistance for Ada, code browsing, aproject explorer, an integrated builderand an integrated debugger. The com-pany offers a separate Ada plug-in forWind River’s VxWorks, but this plug-in produces executables for nativesystems, rather than embeddedprocessors; similarly, the debuggersupports native system debugging. www.adacore.com

LAUNCHPADThe Latest Tools and Technologies

8 | ECLIPSE REVIEW Fall 2006

Page 9: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

THREADED APPLICATIONS HELP UNRAVEL THE ORIGINS OF THE UNIVERSE.Take advantage of the power behind multi-core processors by introducing threading to your applications. Threading allows you to use hardware parallelism to improve application speeds. Intel® Software Development Products are on the leading edge of threading technology, giving you the opportunity to discover the performance potential you need. So whether you create

applications that model the solar system or enable a gaming system, Intel Software Development Products give your applications the power of parallelism.

Visit www.intel.com/software/products/eclipse for more information.

Copyright © Intel Corporation, 2006. All rights reserved. Intel, the Intel logo, are trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.

Remember whenthe sky was the limit?

With Intel® Software Development Products, the Swinburne Center for$VWURSK\VLFV�LV�VKRZLQJ�WRGD\·V�NLGV�D�XQLYHUVH�ÀOOHG�ZLWK�XQOLPLWHG�SRVVLELOLWLHV�

Page 10: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Good News on RCPAdoption

ECLIPSE EVENTSThanks to BZ Media, the Eclipse com-munity has a great new Eclipse con-ference to attend. The second annualEclipse World conference was heldSept. 6–8, 2006, in Boston. By allaccounts it was a great success and agreat place to get solid technical con-tent on different Eclipse projects. Welook forward to the EclipseWorld2007, which will be held Sept. 6–8 inReston, Virgina.

The Eclipse Foundation alsolaunched a new European event inGermany, called Eclipse SummitEurope. It was held Oct. 11–12 inEsslingen, Germany, and attracted300 Eclipse enthusiasts. The Summitfeatured four technical symposia cov-ering topics such as modeling, richclient applications, server-side Eclipseand test-driven development for theembedded systems space.

MAINTENANCE RELEASE FOR THE ECLIPSE CALLISTOPROJECTSA maintenance release of the Callistoprojects was made available onSeptember 29, 2006. All 10 projects thatparticipated in the June Callisto releasecoordinated the availability of their

bug-fix maintenance release for thisdate. Users can go to the Eclipse updatesite to download Eclipse 3.2.1 and thenew releases of the other projects.

IN 2007, IT’S EUROPA!The planning has started for the nextyear’s coordinated release train, calledEuropa. Like Callisto, Europa will fea-ture a coordinated release of the majorEclipse projects. The plans still need tobe completed, but we expect the date to

be late June 2007. The list of projects isexpected to include the entire Callistoproject, plus additional ones. Stay tunedfor more details.

NEW MEMBERS OF THEECLIPSE FOUNDATIONWe would like welcome Simula Labsas a new strategic developer of theEclipse Foundation. In addition, SonyEricsson Mobile, ARM Limited, ActiveGrid andKPIT Cummins have joined asadd-in providers. The Eclipse Founda-tion now has 142 member organiza-tions and more than 750 committers.

PROJECT UPDATES Here is a summary of project reviewsthat have arisen so far in 2006. Wehope to make this a regular feature ofthis column. It is based on the RSSfeed at www.eclipse.org/projects/reviews-rss.php.

A recent Evans Data survey indicated strong growth inthe awareness and adoption of the Eclipse Rich Client

Platform (RCP). A survey of the Eclipse user community indicatedthat almost 23 percent of the respondents were using Eclipse RCP.This is a 130 percent increase over a previous 2005 study. Moreimportantly, the survey indicates strong growth and momentum forfuture RCP usage, with 68 percent of the respondents indicatingthey will be using it within the next six months. A great sign of astrong future for Eclipse RCP.

Table 1 Project Updates

PROJECT REVIEW DATEParallel Tools Platform 1.0 Released Approved Aug. 15ECM Rich Client Platform (Apogee) Project Approved Aug. 15Google Summer of Code Project Created and Provisioned Aug. 18SVN Team Provider Proposal Updated Aug. 20Aperi Storage Management Project Created and Provisioned Aug. 24g-Eclipse Proposal Posted Aug. 25Embedded Rich Client Platform 1.0 Released Approved Sept. 11Eclipse Orbit Project Created and Provisioned Sept. 22COSMOS Proposal Updated Sept. 28Eclipse Platform 3.2 Release Approved Oct. 2Subversive Project Proposal Updated Oct. 5ECM Rich Client Platform (Aprogee) Project Created and Provisioned Oct. 6g-Eclipse Creation Review Oct. 15Model-to-Text Transformation Proposal Posted Oct. 16AspectJ Development Tools 1.4.1/1.5.3 Release Review Oct. 17Model Development Tools Project Created and Provisioned Oct. 18Callisto Simultaneous Release Approved Oct. 19CDT 3.1 Release Approved Oct. 19

FOUNDATIONFrom the Eclipse Foundation

10 | ECLIPSE REVIEW Fall 2006

Page 11: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Wolfram Goes to MathClass, Eclipse Style

Wolfram Research(www.wolfram.com), based inChampaign, Ill., is the developer ofMathematica, a well-known softwareapplication that integrates a numericand symbolic computational engine,graphics system, programming lan-guage and documentation systemalong with connectivity to other appli-cations.

Mathematica can handle complexsymbolic calculations that involve mil-lions of terms; load, analyze and pro-vide visualization of data; solve differ-ential equations and minimizationproblems numerically or symbolically;perform numerical modeling and sim-ulations ranging from simple controlsystems to galaxy collisions, financialderivatives, complex biological sys-tems, chemical reactions, environmen-tal impact studies and magnetic fieldsin particle accelerators; and facilitaterapid application development forengineering companies and financialinstitutions. In short, it does math ina big way. There are nearly two mil-lion users of Mathematica, accordingto Wolfram, in both industry and aca-demia.

Recently, Wolfram released a newproduct called Wolfram Workbench, aversion of the product based onEclipse. Users who currently useMathematica now have a means ofcustomizing the application via thefunctionality inherent in Eclipse, andcurrent Eclipse users now have theability to use Mathematica as a set ofplug-ins in their own Eclipse installa-tions, offering them mathematicalcomputation capabilities that can bealtered to suit their needs. They canalso use Workbench to build theirown technical applications, whetherthey’re addressing engineering, sci-ence, finance or educational markets.

ECLIPSE AS AN IDE… FOR ECLIPSE!In addition to offering the Eclipse ver-sion of Mathematica and its capabili-ties in a plug-in form, Wolfram tookadvantage of another obvious Eclipsecapability: using it as an IDE. In otherwords, the company used Eclipse todevelop for Eclipse.

“It would be possible to build theplug-ins and Eclipse version ofMathematica without using Eclipse,but it would be enormously inconven-ient,” says Tom Wickham-Jones,director of kernel technology and leadWorkbench developer. “One of the

key features of Eclipse is that it pro-vides a great development environ-ment for building Eclipse tools.Eclipse as an IDE is a wonderful toolin itself.”

Wickham-Jones believes that oneof Eclipse’s strengths is its ability tosupport languages other than Java.“Eclipse has great application devel-opment mechanisms and useful APIsand engineering. It’s very suitable forbuilding extra plug-ins that add sup-port for languages other than Java.It’s quite common for people to buildsupport for Python, Perl and otherlanguages. What we’ve done is tobuild support for Mathematica.”

Mathematica is built using a het-erogeneous collection of programminglanguages. Some of it is built in C,some in Java, and lot of it in theMathematica language itself. Theapplication really has no specificdevelopment environment; for theMathematica functionality itself, thereis still no alternative but to useWolfram’s own custom programminglanguage. For developing other partsof the product, the company has useda variety of languages and IDEs suchas C++ and Visual Studio. However,because Mathematica runs on manyplatforms, Eclipse offers the type offlexible support that’s important tomany of its users.

In the future, Wolfram is lookingtoward making use of some of thenewer Eclipse tools that it sees asvery valuable. “We hope to use someof the more recent plug-ins to buildmore tools for Mathematica,” saysWickham-Jones. “All of these plug-inshave their own extension mecha-

It’s a given that any reader of Eclipse Review sees Eclipseas a top-notch development environment. Its extensibility

via plug-ins is an added benefit. Many also know that it can beused a front end or even the basis of an application. While WolframResearch doesn’t go as far as using the Eclipse RCP, it does makeuse of the first three options, making the company somewhat of anew power user in the community of Eclipse development.

Fall 2006 www.eclipsereview.com | 11

George Walsh, a technical writer based inSan Francisco, is a contributing editor toEclipse Review.

SHOPTALKApplications in the Real World | by George Walsh

Page 12: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

12 | ECLIPSE REVIEW Fall 2006

SHOPTALK

nisms. The tools we’re look-ing at in particular are theWeb Tools Platform andC/C++ DevelopmentTooling. To build tools forthe Web version ofMathematica, we would pro-vide users withMathematica WTP tools. Wecould also use CDT to makeuse of Mathematica’s ownextension mechanism tohook into C or C++ code.”

Wickham-Jones believesthat CDT will become espe-cially important toMathematica users. “CDT isrelatively new, but it’s pick-ing up steam. Having a het-erogeneous language system underone IDE is pretty appealing. That’srelevant to Java programmers becauseI think they’re much more likely to beproficient in another language in addi-tion to Java than, say, Visual Basicprogrammers. CDT is another universeof programming languages. It couldeven help Mathematica developersbuild support for Fortran, which isvery important for programmers deal-ing with mathematics. It’s somewhatspecialized, but many large researchlabs have a huge investment in thelanguage.”

The fact that Eclipse is an opensource environment can also addvalue to developers using WolframWorkbench because Eclipse is also asort of how-to manual on Eclipse. Ifsomething doesn’t work, it’s easy torun the code through a debugger, seeyour source code and step into theEclipse APIs to determine why thingsaren’t working the way you expect-ed—a useful way to learn things thataren’t documented.

Wickham-Jones emphasizes thatthe feature provides the hard-coreinner knowledge that’s usuallyreserved for people who have beenprogramming for many years.Typically, commercial tools don’t offerthat capability, but Wolfram providessome of its own source code for exact-ly the same reason—instructing itsusers.

The Wolfram Workbench is an IDEfor Wolfram products that is actuallya version of Eclipse that has beencustomized by adding tools for work-ing with Mathematica and otherWolfram technologies. These toolsare all built, as are all Eclipse tools,with Eclipse plug-ins—the Eclipseextension mechanism.

Wickham-Jones notes that Eclipseplug-ins have access to a large andrich library of functionality that cantake advantage of many useful fea-tures such as encapsulation, version-ing, localization, a help system andWeb-based updating. In addition to itslibrary and components, other keyEclipse features that Wolfram tookadvantage of include the ease withwhich plug-ins can be built.

“Eclipse contains a large number ofwizards and tools for building plug-ins,” Wickham-Jones notes. “As youdevelop, you can easily launch anoth-er installation of the environment thatuses your tools and allows you totrack down problems. The environ-ment makes it easy to create and rununit tests, which can also boost thequality of your application.”

A WORLD OF FEATURES AND FUNCTIONSWolfram sees a world of Eclipse fea-tures that complement its products—and Mathematica functions that couldbe of use to Eclipse users. One avenue

the company is investigatingis enhanced refactoring. Forexample, people conductingresearch often use Eclipse assort of a vehicle for imple-menting their ideas.

Wickham-Jones doesn’tthink it’s common to usegraph theory techniques bythemselves in Eclipsebecause it’s difficult to sup-port large source files thatuse a graph to represent thefiles, functions and compo-nents that relate to othercomponents. He states thatit will soon be possible totake graphs from sourcecode and use the graph the-

ory features in Mathematica to domanipulations on these graphs.

Graph manipulation works well inMathematica, and providing this func-tionality to Eclipse users could poten-tially be very helpful. The applicationalso offers graph layout tools that cansupport tens of thousands of nodes.Future Eclipse functionality may onlybe on the drawing board for now, butthe director of kernel technology seesmany exciting possibilities.

Because Wolfram allows users of itsWorkbench product to use it in stand-alone mode or as a set of plug-ins,Wickham-Jones says Workbench pro-vides another important feature.“Eclipse makes it very easy to producean application that has your own lookand feel rather than the Eclipse lookand feel. This is an important step ingiving your application a fully profes-sional appearance, whether you’resimply using our products or usingour set of plug-ins to add functionalityto your own. We took advantage ofthat feature and assume that users ofour plug-ins will, as well.”

Any company or institution thatrequires extensive mathematical func-tionality now has a tool that they canuse in Wolfram Workbench. At thesame time, we once again see thatEclipse can often be a means to anend, whether it’s used as an IDE oran extension mechanism for otherproducts.

Figure 1 Wolfram Workbench provides an IDE that’s not just good for programming, but for sophisticated numerical analysis.

Page 13: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

While frameworks and tools arethe necessary foundation, you’llhave trouble leveraging DTP(www.eclipse.org/datatools) directlywithout additional components sup-porting your specific data source.While you could follow the ApacheDerby specializations provided aspart of DTP, that’s neither practicalnor desired. Instead, you’d probablyrather have specialized data sourcesupport close at hand. That’s wherethe DTP Enablement project comesin: It seeks to offer as many open-source data sources as possible. TheEnablement project will serve as aclearinghouse for DTP data source

support. Here, we’ll explain the ini-tial steps you’ll use to access rela-tional data sources using DTP.

LEVEL OF INTEGRATIONA data source can integrate withDTP on several levels. Depending onyour requirements and data source,it might make sense to support all ofthese levels, or only some of them.Each DTP core project exposes APIand (where relevant) extensionpoints. These two elements are thetouchpoints for DTP integration.You’ll want to survey the opportuni-ties that DTP gives for extension,noting the places that are useful foryour data source.

The first thing to consider iswhether the data source’s domain isrepresented in an existing DTPModel Base component. As of DTP0.9, the Model Base components areall EMF-based domain models forrelational data sources. If your datasource is relational, it makes senseto specialize the Model Base compo-nents for your case, since thisavoids duplicating effort and offersmodel-driven representation of therelational domain.

Each data source has a channel,or connection, through which other

components communicate with it.Typically, you’ll need a driver andconfiguration information to gainaccess to that data source. Each con-nection is likely to have differentconfiguration settings, while thelocation and default values for thedriver are usually constant acrossconnections. In DTP Connectivity,these requirements are met by thedriver template and connectionmanagement frameworks, alongwith their associated tools.

Once you establish the connec-tion and populate a domain modelwith its contents, the next step is tobuild tools using these capabilities.For relational data sources, DTP hasthe SQL Development Tools project.This project contains tools thatyou’d expect from an entry-level,developer-centric SQL tool, includ-ing a SQL editor, results view, theability to execute SQL statementsand so on. The SQL tools in the cur-rent DTP release work with relation-al data sources based on the SQLmodel in a generic manner.

Once you specialize a model andprovide connectivity for a relationaldata source, you should get basicSQL tooling support by default. Inmany areas, you might want toadapt the SQL tools to take advan-tage of specific functionality. If youstudy the Apache Derby sampleimplementation in DTP 0.9, itshouldn’t be hard to understand anduse them for other cases.

MODEL SPECIALIZATIONAs part of the core, the Model Baseproject houses domain object mod-

Grab Relational Data WithThe Data Tools Platform

Dealing with data that’s stored in an outdated relationalform is often the bane of a developer’s existence. However,

that data is typically still valuable and accessing it is a necessity.Having an intuitive and relatively easy-to-use means of making itavailable is the goal of the Data Tools Platform. The three foundingprojects comprising DTP—Model Base, Connectivity and SQLDevelopment Tools—meet the platform goals that their names implyin the DTP 0.9 release, and form what we’ll call the DTP core.

Fall 2006 www.eclipsereview.com | 13

Larry Dunnell is a software engineer atIBM, and is a committer for the Data ToolsPlatform as well as the data tools compo-nents in the Web Tools Platform Project.

John Graham of Sybase has been develop-er on Eclipse since version 1.

Brian Fitzpatrick of Sybase has workedextensively in Java on Eclipse-based proj-ects, eventually becoming a founding com-mitter on the Eclipse Data Tools Platform.

Hemant Kolwalkar is an advisory softwareengineer at IBM Rational, and works on thedevelopment of IBM Rational Data Architectand the Eclipse Web Tools and Data ToolsPlatform projects.

PROJECTSFundamentals of the Platform | by Larry Dunnell, John Graham, Brian Fitzpatrick and Hemant Kolwalkar

Page 14: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

PROJECTS

els for use with the rest of DTP. Tokeep the scope manageable in thefirst data source releases, DTP’sdesigners decided to concentrate onmodels for relational data sources.Based on the Eclipse ModelingFramework (EMF), it includes mod-els for the following:

• SQL: Based on the SQL 99/03specifications, SQL is the basisfor the other models

• Database Definition: For spe-cializations not covered by theSQL Specification

• SQL Query: An abstract view ofactual SQL queries

• SQL XML Query: An abstractview of XML data processed inSQL queries

Unlike many other Eclipse plat-form components, you’ll need to dosome work to use the models withyour own database. The key steps ofthis process are to create your data-base definition and expand theEcore/Genmodel for the SQL Model.

DATABASE DEFINITION SURVEYThe SQL Model is a metamodel basedon the SQL 99/03 specifications,which defines all database elementsfor the industry standard. A databasedefinition model derives from the SQLModel, in which all detailed databasemodel elements—including tables,columns, user-defined data types, rela-tionships and constraints, stored pro-cedures and their detailed parame-ters—are implemented.

The DTP Model Base provides aJava program to create a new data-base vendor document and is storedin XML Metadata Interchange (XMI)format. The Java class uses thedatabase definition model as a base,then goes through the model ele-ment-by-element, setting specificdetails. It walks through items suchas columns, views and triggers,specifying available data types andqualities for those items. When theJava program is run, it will create anXMI document to serve as the data-

base vendor documentation.

EXPOSING THE VENDORDOCUMENTOnce you’ve generated a database--specific XMI database vendor docu-ment, you will need to use theorg.eclipse.datatools.connectivity.sqm.core.databaseDefinition extensionpoint to expose it. You can extend thedatabaseDefinition extension point fororg.eclipse.datatools.connnectvity.sqm.core using the following defini-tion:

<definitionversion="4.0"

product="MySql"

productDisplayString="%4.0_ProductString"

versionDisplayString="%4.0_VersionString"

file="runtime/vendors/MySql_4.0/MySql_4.0.xmi"></definition>

These values specify a uniquename and version string for thisgiven vendor XMI document—MySQL as the product and 4.0 asthe version.

If you look at the extensionpoint’s file property, it refers to aparticular path to the XMI documentin the plug-in that exposes it. Thedirectory under runtime/vendorscorresponds to [product] underscore[version,] just like the XMI file’sname, MySQL_4.0. A display stringfor the product and version is pro-vided to make it more human-read-

14 | ECLIPSE REVIEW Fall 2006

Table 1 Primitive types supported by the base SQL model

Character data

Character

character varying

character large object

national character

national character varying

national character largeobject

Binary data

Binary

binary varying

binary large object

Numeric data

Numeric

Decimal

Smallint

Integer

Bigint

Float

Real

double precision

Other

boolean

date

time

timestamp

interval

datalink

xml

Survey Questions

The following questions allow you to gather the infor-mation necessary to customize a Java program foryour particular database. Once the information is gath-ered, you can go through the program and specify thedetails for the database definition. For example, youwould probably want to set the schema support to avalue of false if you’re working on a MySQL data-base.

1. What versions do you support? Are the answers tothe following questions different depending on whichversion you’re discussing? Each database/versioncombination should be represented by a unique data-base vendor document that will then be exposed viathe org.eclipse.datatools.connectivity.sqm.core.databaseDefinition extension point.

2. Are view triggers supported?3. What's the maximum identifier length?4. What's the maximum comment length?5. Is sequence supported?6. Is MQT supported?7. Is alias supported?8. For columns:

a. Is identity supported?b. Is computed supported?c. Is Identity start value supported?d. Is identity increment supported?e. Is Identity maximum supported?f. Is Identity minimum supported?g. Is identity cycle supported?

9. For constraints:a. Is a clustered primary key supported?b. Is a clustered unique constraint

supported?10. What primitive types are supported: character, deci-mal, double, integer or numeric? The base SQL modelsupports the types shown in Table 1. For each, youwould populate your specialized model, as in the exam-ple shown in Listing 1.

To make setting these values easier, the ExampleForVendorPrimitiveWrite.java file found at www.eclipse.org/datatools/project_modelbase/modelbase_doc/sampleZip/ExampleForVendorPrimitiveWrite.java can beused.

Page 15: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

PROJECTS

Fall 2006 www.eclipsereview.com | 15

able. In this case, the 4.0_ProductString and 4.0_VersionString areoffered via the plugin.properties file.

EXPANDING THEECORE/GENMODELTypically, you don’t need to alter thedefinition for SQL Model. However, ifyou do need to add new model defi-nition to the SQL Model, completethe following steps:

• Change the SQL Model file toadd your database element orcreate a new Ecore that refer-ences the existing SQL ModelEcore file and extend it.

• Use the Eclipse framework togenerate a new EMF model.

• Generate code to create a newDatabase Definition Model.

For example, you may want to addan event object to the schema ele-ment in the model. You would needto create your own model object foran event and then create a uniqueelement that extends the schema ele-ment in the SQL model.

DEFINING A DRIVER TEMPLATEAccess to a database is typicallymediated by a driver. In the simplestcase, a JDBC driver will be availablefor your target database. It’s worthnoting here that DTP as a platformsupports the driver concept in avery generic sense, so JDBC is notrequired. You could, in fact, use anODBC driver, a call-level interface(CLI) or other mechanisms as a con-duit to the database. The SQL modelfamily, however, expects a JDBCinterface, so you’d have to map suchalternatives onto JDBC interfaces touse the models.

The first question you need toanswer is whether or not you need adriver template. DTP provides ageneric JDBC driver template inwhich the user can specify the loca-tion of the driver archive (jar) andstandard properties such as connec-tion URL, database name and so on.The disadvantage of this approach isthat reasonable defaults for specificdatabases can’t be expressed, sousers have to provide this predictable

information. An advantage is thatyou can specify JAR file names andperhaps even locations if these canbe predicted. These default sugges-tions make it easier for users tounderstand what is required for thedriver template and how to locate thenecessary information.

Once defined, a driver template isglobal to the Eclipse instance, drivenby a preference page. We’re talkingabout templates here, which impliesa set of defaults to be overridden. Infact, users create a driver definitionbased on a provided template. Adriver definition is an instance of adriver template and is a relationship

that can be understood loosely asthe same as class and object in Java.The advantage of having global driv-er templates and definitions is thatthese values tend not to be specificto tools that consume them, so othertools that require access to driverdefinitions can use the global val-ues. From a user’s perspective, thisprovides a very important benefit: Itenables the definition of a specificdriver once, rather than having tokeep reentering the properties foreach tool.

DTP provides a driver manage-ment framework, with associatedpreference pages and wizards, for

Listings

n LLIISSTTIINNGG 11:: AANN EEXXAAMMPPLLEE OOFF CCOODDEE FFOORR SSUUPPPPOORRTTIINNGG TTHHEE PPRRIIMMIITTIIVVEETTYYPPEESS SSHHOOWWNN IINN TTAABBLLEE 11PredefinedDataTypeDefinition characterDataTypeDefinition =

DatabaseDefinitionFactory.eINSTANCE.createPredefinedDataTypeDefinition();characterDataTypeDefinition.setPrimitiveType(PrimitiveType.CHARACTER_LITER-AL);characterDataTypeDefinition.getName().add("CHAR");characterDataTypeDefinition.getName().add("CHARACTER");characterDataTypeDefinition.setMaximumLength(254);characterDataTypeDefinition.setKeyConstraintSupported(true);characterDataTypeDefinition.getDefaultValueTypes().

add(DefaultValueType.CURRENT_USER_LITER-AL);characterDataTypeDefinition.getDefaultValueTypes().

add(DefaultValueType.NULL_LITERAL);characterDataTypeDefinition.setLengthSupported(true);characterDataTypeDefinition.setJdbcEnumType(1);characterDataTypeDefinition.setJavaClassName("java.lang.String");

n LLIISSTTIINNGG 22:: PPAARRTT OOFF TTHHEE EEXXTTEENNSSIIOONN MMAARRKK--UUPP UUSSEEDD IINN DDTTPP FFOORR TTHHEEEEXXEEMMPPLLAARRYY GGEENNEERRIICC JJDDBBCC DDRRIIVVEERR TTEEMMPPLLAATTEE<extension

point="org.eclipse.datatools.connectivity.driverExtension"> <category

id="org.eclipse.datatools.connectivity.db.driverCategory"name="%org.eclipse.datatools.connectivity.db.driverCategory"/>

<driverTemplate createDefault="false" emptyJarListIsOK="false"

id="org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate"jarList=""

name="%org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate"parentCategory="org.eclipse.datatools.connectivity.db.driverCategory">

<properties><property

generated="false"id="org.eclipse.datatools.connectivity.db.driverClass"name="%driverClass"value=""required="true"visible="true"/>

</properties></driverTemplate>

Page 16: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

managing these templates. As a DTPextender, all you need to do is con-tribute to the org.eclipse.datatools.connectivity.driverExtension.

Listing 2 shows part of theextension mark-up used in DTP forthe exemplary generic JDBC drivertemplate.

Without covering all details(which can be found in the API doc-umentation provided with DTP),you’re essentially specifying a list ofproperties for the template, alongwith any known reasonable defaultvalues. Also note that there’s a “vis-ible” attribute available for eachproperty. This allows you to haveread-only properties that are notshown to users, but consumed bydownstream tools. The driver man-agement preference pages and wiz-ards are generated automaticallybased on the property values givenin a template definition. Attributessuch as Required are used to deter-mine when a driver definition isconsidered complete.

DEFINING A CONNECTION PROFILEA connection profile is a group ofproperties that acts as the particularconnection type’s definition. Forexample, a particular database mighthave one or more associated drivertemplates (for versions, driver typesand so on).

A connection profile for that data-base is capable of consuming thatinformation in a selected driver defi-nition and using it to establish aconnection to the database. A con-nection profile is responsible forsupplying a content provider torequesting tools, such as the tree-based paradigm found in the DTPData Source Explorer (DSE).

Once again, the notion of connec-tion profile is agnostic with respectto the actual connection type. Thatis, the connection profile providesan abstraction over the connectiontype, which gives consuming toolsflexibility in interacting with hetero-geneous data sources.

As with driver templates, connec-tion profiles are managed by the

16 | ECLIPSE REVIEW Fall 2006

Listings

n LLIISSTTIINNGG 33:: PPAARRTT OOFF TTHHEE CCOONNNNEECCTTIIOONN PPRROOFFIILLEE DDEEFFIINNIITTIIOONN FFOORRGGEENNEERRIICC JJDDBBCC<extension

point="org.eclipse.datatools.connectivity.connectionProfile"><category

id="org.eclipse.datatools.connectivity.db.category"name="%databases.category"/>

<connectionProfilecategory="org.eclipse.datatools.connectivity.db.category"icon="icons/jdbc_16.gif"id="org.eclipse.datatools.connectivity.db.generic.connectionProfile"name="%generic.profile.name"/>

<connectionFactory

class="org.eclipse.datatools.connectivity.db.generic.JDBCConnectionFactory"id="java.sql.Connection"name="JDBC Connection"

profile="org.eclipse.datatools.connectivity.db.generic.connectionProfile"/></extension>

n LLIISSTTIINNGG 44:: PPAARRTT OOFF TTHHEE CCOONNNNEECCTTIIOONN PPRROOFFIILLEE DDEEFFIINNIITTIIOONN FFOORRGGEENNEERRIICC JJDDBBCCprotected Object createConnection(ClassLoader cl) throws Throwable {

Properties props = getConnectionProfile().getBaseProperties();Properties connectionProps = new Properties();

String driverClass = getDriverDefinition().getProperty(

IDBConnectionProfileConstants.DRIVER_CLASS_PROP_ID);String connectURL =

props.getProperty(IDBConnectionProfileConstants.URL_PROP_ID);String uid =

props.getProperty(IDBConnectionProfileConstants.USERNAME_PROP_ID);String pwd =

props.getProperty(IDBConnectionProfileConstants.PASSWORD_PROP_ID);String nameValuePairs =

props.getProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID);

String propDelim = ",";

if (uid != null) {connectionProps.setProperty("user", uid);

}if (pwd != null) {connectionProps.setProperty("password", pwd);

}if (nameValuePairs != null && nameValuePairs.length() > 0) {String[] pairs = parseString(nameValuePairs, ",");String addPairs = ""; //$NON-NLS-1$for (int i = 0; i < pairs.length; i++) {

String[] namevalue = parseString(pairs[i], "=");connectionProps.setProperty(namevalue[0], namevalue[1]);if (i == 0 || i < pairs.length - 1) {

addPairs = addPairs + propDelim;}addPairs = addPairs + pairs[i];

}}

Driver jdbcDriver = (Driver) cl.loadClass(driverClass).newInstance();return jdbcDriver.connect(connectURL, connectionProps);

PROJECTS

Page 17: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

connection management framework,along with associated wizards andother UI support. Contributions tothe connection management frame-work are made visible by the exten-sion point org.eclipse.datatools.con-nectivity.connectionProfile. Listing 3shows part of the connection profiledefinition for generic JDBC.

Keep in mind a few key points.The first is that a connection profileis associated with a given categorydefined in the category mark-up.You could reuse a category definedelsewhere, for example, to add aconnection profile to the categoriesprovided by default. TheconnectionProfile mark-up is simplya declarative way of setting the cate-gory and name icon in the connec-tion profile. The key implementationcomes in the connectionFactory sec-tion. A connectionFactory gives theimplementation class that is respon-sible for creating and maintainingconnections based on client

requests. In this case, theJDBCConnectionFactory class pro-vides the implementation. Being afactory, an instantiation provides, inthis case, JDBCConnection objects.When the client wants to connect tothe database represented by thisprofile, the code shown in Listing 4is executed in JDBCConnection.

Here, we see the use of propertiesdefined by the driver definition andspecified by the user. After these prop-erties are retrieved, the code is fairlystandard for setting up a JDBC connec-tion.

In this simple case, why do we needthe overhead of a driver definition andconnection profile? At first glance,these seem like overkill, but the maingoal of DTP connectivity is to providean abstraction over the notion of con-nection, encapsulating the implementa-tion details so client tools can workwith connections uniformly.

While the generic JDBC case isstraightforward, more complex data

sources will require much more pro-cessing, and the benefit to clients isthe uniform abstraction delivered bythe frameworks.

MAKING THE CONNECTIONMost of the work in using DTPinvolves creating an EMF-basedmodel for the particulars of yourdatabase. Driver and connection sup-port is attained by leveraging the con-nectivity frameworks. While theinformation given here is not com-plete in every detail, it should containenough of a trail guide to help younavigate the Apache Derby imple-mentation shipped with DTP 0.9 andcustomize it as necessary.

The DTP Enablement project willcontinually include more completeand complex examples for databases.These will serve a dual purpose: pro-viding data source support close athand to the DTP core and serving asfurther examples of what can bebuilt on the Data Tools Platform.

PROJECTS

Fall 2006 www.eclipsereview.com | 17

Page 18: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides
Page 19: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Installing Eclipse is like moving into a new apartment—it’s spacious, intelligently laid out, boasts shiny, cleverlydesigned appliances… but it’s bare. To make an apart-

ment livable, you put your stamp on it, you move in yourfurniture and your wall art and your game console. Tomake Eclipse really sing as your development environ-ment, you need to extend the basic IDE with tools tailoredto your tasks and foibles.

In short, you need to go on a plug-in hunt. You couldsimply grab one of the preassembled Eclipse distributionsset up with whole sets of plug-ins, and there certainly aresome excellent ones out there, such as MyEclipse. Butthere’s a lot to be said for rolling your own environment,and I’ve focused here on the a la carte approach.

It wasn’t easy to choose among the hundreds of plug-ins out there, and your mileage may vary. I’ve assembledsome real stars in each of seven categories:

• Language support• UI design• UML, modeling and process support• Back-end integration and framework support• Utilities• Testing and code analysisA word on licensing: Free is nice, but I haven’t neg-

lected commercially licensed tools either. Somebody ispaying to write these tools, whether it’s for sale, as acorporate contribution to the community, or the leg-endary spare-time hacker (when I get some, I’ll becomeone, I always say). It costs either dollars or opportuni-ties to develop good software like this, so you shouldseriously consider paying your share one way or theother. Buy, contribute money, or contribute resourceslike time or server space to these projects. We’re all thebetter for it.

Sermon over. Without further ado... the winners, ifyou please!

LANGUAGE SUPPORTWithout getting into a which-language-is-best mud-wrestling match—I know, but I’ll never get you toagree—here are some great plug-ins for widely used languages.

Ruby Development Tools/Radrailswww.rubypeople.org and www.radrails.orgLicense: Common Public License / Eclipse Public License

It takes serious gumption to admit in this magazinethat I code so much in Ruby. But I climbed aboard theRuby bandwagon in 2001, when it was nothing but a redRadio Flyer squeaking by with Matz, Dave Thomas, AndyHunt and a couple of kazoos. These days... breathes therethe programmer who hasn’t been swamped by the Railshype? If you’re intrigued by the idea of painless database-driven Web app development, grab these two plug-ins andgo for it. RDT makes Eclipse aware of Ruby’s syntax, withsyntax coloring and checking, an outline view, Test::Unitintegration and Ruby debugging. (Refactoring is Ruby’sAchilles’ heel: In RDT, it’s limited to block comment/uncomment! And I’ll make you Java hacks a deal: Youdon’t bring up autocompletion, I won’t bring up checkedexceptions.) Radrails provides management tools for con-figuring and running Rails Web applications. Neither hasthe laundry list of features that you’ll find in, say, J2EEtools, but in a way, that’s the point: Rails frees you from alot of that picayune detail.

oXygen Plug-in Editionoxygenxml.comLicense: Commercial

XML is definitely here to stay, like it or loathe it (YAML,anyone?). Many of the features that make XML easy forcomputers to parse make it hellish for humans to edit—hence oXygen. This critter handles syntax highlighting andautocompletion, DTD and schema validation (includingXML Schema and Relax NG), and features both an XSLTtransformer and debugger. It also includes refactoring tools

n BY RICK WAYNE

27 Must-Have EclipsePlug-Ins: Get Them Now!

There are hundreds—maybe thousands—of greatEclipse plug-ins available. Which are best?

Rick Wayne ([email protected]) is a software developer for theUniversity of Wisconsin, where he has far too much fun buildingJava and Web applications. He started coding professionally in 1984,writing about it in 2000, and teaching it in 2001.

Fall 2006 www.eclipsereview.com | 19

Page 20: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

for XML and XSLT, XQuery, a built-in Subversion client andspecial-purpose editors for specific XML dialects like XSL:FOfor PDF production or other page-formatting tasks, theScalable Vector Graphics format (with a live preview) andthe Web Services Definition Language (WSDL).

EPIC (Eclipse Perl Integration)e-p-i-c.sourceforge.netLicense: CPL

Brethren of Perl, I say unto you, suffer no longerunder vi or EMACS! Step with me into the light ofEclipse (guess that’s an oxymoron). At any rate, ifyou’re not digging for Rubies or wrestling Pythons, thePerl world is probably your oyster, and this little plug-inoffers syntax highlighting and on-the-fly checking,quick-reference documentation, expandable code tem-plates, a debugger, an outline view and a regular-expres-sion evaluator.

Visual SlickEdit Plug-inslickedit.comLicense: Commercial

Until the big-forehead aliens gift us with thought-drivencomputers, programming is going to be primarily aboutediting text. Deal.

Of course, one way to do so is to put the biggest,baddest text-editing tools available into your personalbox, and SlickEdit is certainly one of those. I’ve beenprogramming for dollars since 1984, and I have to tellyou that this thing supports languages I’ve never even

heard of. Some of the con-ventions are a little odd tothose of you weaned onCUA (“Copy a line with asingle keystroke”—huh?).But trust me on this one—it flies. Now, if they’d justship a Macintosh version...

PHPEclipsephpeclipse.deLicense: CPL

There are plenty of dedi-cated PHP IDEs around,but none of them offerEclipse’s potent combina-tion of cross-platform com-patibility and a maturetoolset for so many devel-opment tasks. PHPEclipseoffers syntax coloring forHTML, XML, CSS and ofcourse PHP, with codecompletion for the latter.You also get a debuggerand Eclipse’s highly usefuloutline view of your code;when it comes time fortesting, you can control

your test Web and database servers from within Eclipse,and see the results right in the IDE.

UI DESIGNWYSIWYG Java UI design tools appeared shortly after thedinosaurs died out, but any prehistoric Java hacker watch-ing her Visual Basic colleague at work was likely to turn afetching shade of green. And my programming partner,the Finn, still refuses to do UI in Java. I need to get himone of these.

WindowBuilder Pro 5.1.0http://windowbuilderpro.comLicense: Commercial (pared-down version is free)

Third-gen tools like WindowBuilder Pro ease the painof layouts, event handlers and alignment that used to beour lot. WindowBuilder Pro sports round-trip engineeringof both Swing and SWT, drag-and-drop rearrangement ofGridBagLayouts and internationalization support, all inpure Swing or SWT—it doesn’t add a single JAR to yourapplication!

Jigloo SWT/Swing GUI Builder 3.9.2cloudgarden.com/jiglooLicense: Free for noncommercial use

Lock-in is beautiful if you’re a vendor, ugly if you’rea coder. Jigloo not only does round-trip GUI design, it’sspecifically designed to handle UI code generated byhand or in Netbeans, JBuilder or the Visual Editor plug-in. It can convert a GUI from Swing to SWT and vice

20 | ECLIPSE REVIEW Fall 2006

Must-Have Plug-Ins

Figure 1 Omondo EclipseUML generates a ton of UML 2.0 diagrams and sports a handy pan-and-zoom tool for navigating them.

Page 21: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

versa, and offers a toolbar button to preview your interface.

Visual Editoreclipse.org/vep/WebContent/main.phpLicense: EPL

The Eclipse Visual Editor Project is primarily infra-structure for generic visual editors in Eclipse, but happi-ly ships with GUI builders for both Swing and SWT.Nothing too novel for the end user, of course; you getdrag-and-drop component placement, round-tripping(the only state saved is in the Java source code, so youcan edit text or whang GUI components around) andproperty editors for the components. New in 1.2 (thelatest version at press time) are support for JFace view-ers, support for Mac OS X and an XML MetadataInterchange (XMI) view for developers who want to seethe internal model.

UML, MODELING AND PROCESS SUPPORTPerhaps it’s heretical to proclaim in a tools article thatcommunication trumps code-tweaking. But experienceshows that when projects fail, it’s usually because thecoders and stakeholders are on different wavelengths.Concision is key, and UML 2.0 is our best shot yet at aconcise, accurate, widely comprehensible channelbetween modelers, architects and programmers. And evenwithin the programming shop, tools can significantly light-en the day-to-day load.

Omondo EclipseUMLwww.omondo.comLicense: Commercial (single-user free version available)

Omondo’s EclipseUML supports diagrams common(class, activity) andobscure (robustness,deployment), and neatlyround-trips from your code,with too many features tolist here. The company’ssupport for XML MetadataInterchange gives us hopethat modeling tools willone day be interchange-able—bravo!

Eclipse Process Frameworkand OpenUPeclipse.org/epfLicense: EPL

Like standards, the lovelything about software devel-opment processes is thatthere are so many to choosefrom. The Eclipse ProcessFramework project, in incu-bator phase at press time,plans to create a minimaland extensible iterative

process that’s useful out of the box, and is supported bytools integrated with Eclipse. (See Per Kroll and Kurt Sand’sarticle in this magazine, “A Development Library at YourFingertips,” Summer 2006.) OpenUP/Basic, as its nameimplies, draws on IBM Rational’s RUP, but is aimed at small-er teams and smaller projects. This is definitely a project towatch.

Subclipsesubclipse.tigris.orgLicense: EPL

I highly respect the venerable CVS revision-controlsystem, but let’s be honest: Subversion is just better. It’ssmarter about offline work and network traffic, the revi-sion numbers are per-commit instead of per-file, andtags and branches are cheap and simple to use. (Andone use case alone motivated me to switch: Renamingfolders. ’Nuff said.) The Subclipse plug-in works verysimilarly to the CVS Repository Explorer and can handlerepositories in local files or served up via theSubversion daemon, WebDAV, HTTP or tunneledthrough Secure Shell (svn+ssh). Daily operations likeupdate, commit and compare against the latest or baserev are just a right-click away, though I admit I do keepthe command-line Subversion client around for thefunkier stuff.

AccuBridgewww.accurev.com/accubridge-eclipse.htmlLicense: Commercial (free plug-in to SCM product)

Any SCM system stores file revisions, but AccuRevexcels at the edge use cases that are problematic for CVSor Subversion: promotion, merging, change packages,even demonstration of regulatory compliance. The

Fall 2006 www.eclipsereview.com | 21

Must-Have Plug-Ins

Figure 2 Log4E right-clicks to painlessly add a logging statement to source.

Page 24: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

AccuBridge plug-in lets you enjoy stream SCM withoutever leaving the comfy confines of Eclipse.

BACK-END INTEGRATION AND FRAMEWORK SUPPORTThe new UI tools notwithstanding, Java programmingtoday is primarily about server-based enterprise applica-tions, and these plug-ins hook Eclipse up with themachinery that makes it run.

Terracotta Distributed Shared Objects terracottatech.com/terracotta_DSO.shtml License: Commercial (free plug-in to commercial tool)

I’m cheating a bit here. Terracotta DSO is not itself anEclipse plug-in; it’s no little freeware utility. It’s enter-prise infrastructure, a slick means of exploiting paral-lelism with minimal pain, scaling your J2EE applicationsby sharing their heaps across multiple JVMs. ThisEclipse plug-in makes that process easier and moregraphical, generating the necessary XML config files foryou and allowing you to control the servers.

Hibernate Synchronizerhibernatesynch.sourceforge.netLicense: GNU Lesser General Public License

Is de-drudginator even a word? Well, it should be. TheHibernate Synchronizer certainly is one. As with anymapping framework, Hibernate’s database and codesides take some scutwork to keep in synch; theSynchronizer is designed to generate value objects, com-posite key objects, data access objects and suchlike auto-matically whenever the mapping files change. Of course,anyone who’s used a code generator knows that theproblems don’t occur the first time you use it; it’s thesecond, when the blamed thing overwrites all your cus-tomizations, that’s so annoying. Synchronizer cleverlygets around that by generating abstract base classesalong with an extension class. Only the former is over-

written in subsequent regens, so your code in the latterstays safe.

Hibernate Toolswww.hibernate.org/255.htmlLicense: LGPL

While the Synchonizer does one small task well, theHibernate Tools do… well, basically everything else relat-ed to the Hibernate persistence framework. Not only dothe Hibernate Tools bolster your ability to create configu-ration and mapping files, they’re round-trip—you canpoint the Tools at an existing database (or an existingHibernate configuration) and get Java, config and map-ping files automagically. The Hibernate Tools provide amapping editor, a Hibernate console manager and a setof wizards for configuration and code generation.

Spring IDEspringide.org/projectLicense: Apache

When I first started learning about J2EE, I felt ratherstupid. “Whoa—this is a lot of stuff.” Little did I realizethat I was merely ahead of the curve (hey, that’s mystory, and I’m sticking to it like white on rice).

Spring was born of frustration with J2EE complexity.It’s a full-stack application framework that’s consider-ably easier to use and deploy, while remaining compati-ble with many of the original J2EE technologies. Andthe Spring IDE is the Eclipse way to get on that band-wagon, offering a straightforward wizard to createSpring projects, then a set of editors and builders toextend, modify and validate the config files and beansthat make up a project.

Log4Elog4e.jayefem.deLicense: Parallel free and commercial versions

Since you’re not going tobe glued to the debuggerfor the life of your soft-ware, you’ll occasionallyneed to know what it’sbeen up to, after the fact.So: logging. Pretty soonyou’ll outgrow printlnstatements and want to usesomething a little morepowerful and configurable;Log4e greatly streamlinesincorporation of JDK log-ging, Log4J or JakartaCommons logging in yourprojects. You just right-click, and Log4e handlesinsertion of the appropriatestatements; it can alsoautomatically replace thoseSystem.out.printlns for you.It’s a tool worth using.

24 | ECLIPSE REVIEW Fall 2006

Must-Have Plug-Ins

Figure 3 Tiger XSLT Mapper visually hooks up source and target XML to create XSLT style.

Page 25: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

UTILITIESThe beauty of the Eclipseecosystem is that itencourages these littlegems of functionality andintegrates them into yourwork.

QuickRExbastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html License: EPL

Perl hacks used to sneerat Java coders, parsingtheir way through Stringswith index() andrindex().Once we got regu-lar expressions, of course,they went from snobberyto sympathy. Sure, regexesare powerful and succinct.Then again, so was APL,and frustrated Java pro-grammers quickly filled upthe 12-step groups.

Not only does QuickREx allow you to rapidly iteratetoward a regular-expression solution on test text, itoffers tab-key suggested completions, automaticallyescapes those pesky backslashes for you, and allowsyou to compile your best gems in a personal regular-expression library.

Tiger XSLT Mapperwww.axizon.comLicense: Commercial

If you don’t use Extensible Stylesheet LanguageTransformations (XSLT) to modify XML streams, or thinkthat it has just jumped the shark, go on to the nextplug-in. (If, worse, you think XSLT so transparent thattools are redundant, the door is that-a-way, fella.) But ifyou need this plug-in, you almost certainly need it fourhundred smackers’ worth. It’s nothing less than a point-and-click mapper for transforms.

You drag between the source XML on the left and thetarget XML on the right, it comes up with the trans-forms for you, in your choice of “optimized” or“human-readable” flavors. The reduction in your Tumsbudget alone might cover it.

EHEP (Eclipse Hex Editor Plug-in)ehep.sourceforge.netLicense: GNU Public License

Like Garrison Keillor’s “A Prairie Home Companion,”all of our software is sponsored by “Raw… Bits.” Andsometimes, ya just gotta grit your teeth and plunge into’em.

Programmer’s text editors like BRIEF, Epsilon andSlickEdit have had this basically forever; frankly, I wasnonplussed that Eclipse lacks this feature out of the box.EHEP offers a hex view of binary files, lets you viewthem under a variety of encoding schemes (for example,ASCII, ISO8859_5 or MacUkraine), and supports search-ing for either hex or text strings.

TESTING AND CODE ANALYSISTest and prevent now, or fix bugs later. It’s really up toyou (and your manager or customer), but “now” is a lotcheaper and faster.

Lattix LDMlattix.com/products/products.html License: Commercial

“Cycles of dependency” concern more than just wel-fare researchers. Useful code necessarily is complex—but not inevitably unmanageable!

To “help you discover, analyze, define and controlyour architecture,” Lattix built LDM. Peter Varhol’srecent article in this magazine, “Leaving the Crystal BallBehind” (Summer 2006), discussed this, showing that itvisualizesdependencies in a collapsible matrix, helpingyou stick to a layered architecture and minimizedependency cycles.

Fall 2006 www.eclipsereview.com | 25

E r

Must-Have Plug-Ins

A Plethora of Plug-Ins

Two great places to start looking for more plug-ins are www.eclipseplugincentral.comand www.eclipse-plugins.info; both sites organize available plug-ins by category,ranking them by popularity (number of click-throughs) and user rating. A word ofcaution: Some of the plug-ins rise to the top (especially in the latter rankings) onpretty small sample sizes.

Figure 4 The Findbugs Eclipse Plug-in analyzes your source code for common problems,integrating with Eclipse’s problem list and source markers.

Page 26: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Parasoft Jtestparasoft.com/jsp /products.jsp License: Commercial

Combining mercilesscode scrutiny with auto-mated test-case generation,I predict that Jtest will startby humbling you and fin-ish by empowering you. Itapplies literally hundredsof rules (the list is cus-tomizable, of course) to astatic analysis of yoursource code, then automat-ically generates test casesto wring it out, and evenhelps track down the hard-to-spot runtime issues.

Cenqua Clovercenqua.com/cloverLicense: Commercial

If you’re using Eclipseand you’re not doing unittesting… we need to talk,because I’m interested inhow you stay in business. Even if you are, and your devel-opers proudly report creating such-and-so-many unit testseach week… how on earth do you know if they’re writingthe right ones? Clover is a code coverage tool aimed at find-ing out the answer, and it tells you by statements, branchesand methods. Not only does it give you a coverage snap-shot, but it reports the trend over time; reports come out inthe plug-in’s UI, in HTML, PDF or XML for ingestion intosome other tool. Clover won a Productivity Award in lastyear’s Jolt Awards and was well regarded by the judges.

Eclipse Profilereclipsecolorer.sourceforge.net/index_profiler.htmlLicense: CPL

A basic profiler plug-in, the Eclipse Profiler can displayrunning threads and a call tree for a thread. Tooltips pro-vide timing info; you can jump from a call-tree node to itsdefinition in the code. You can also see profile informationby class or package, filtered to zero in on the items ofinterest. Eclipse Profiler can do remote profiling; for exam-ple, the Tomcat heap, but you’ll need to manually set upenvironment variables or command-line switches on theprogram being run to do so.

EJ Technologies JProfilerej-technologies.comLicense: Commercial

If you want to get fancier with your profiling and don’tmind paying for it, consider JProfiler. As with EclipseProfiler, remote connections require a bit of command-linetweaking, but JProfiler includes wizards to hook up tocommon application servers, and can do tricks like ana-

lyzing a profiling session post hoc or comparing two ses-sions. You can slice the loaf several ways: by CPU, bythread, or by walking the heap to find allocation hotspots.

Findbugs Eclipse Plug-infindbugs.sourceforge.netLicense: LGPL

Findbugs is an open-source code analyzer—think of it aslint for Java on steroids. But there’s a crucial difference:Findbugs doesn’t deluge you with an undifferentiated wailabout problems pressing and picayune. Instead, it catego-rizes them usefully: correctness, bad practice and style, andapplies confidence ratings to its analysis, to emphasizewhat it’s sure is wrong. The Eclipse plug-in, of course, inte-grates Findbugs intelligence into the IDE, decorating yoursource windows with problem markers (and adding lines tothe Problems view); you can control which of its rules arerun against your code, and the level of hysteria you’re will-ing to tolerate. The rules run the gamut from the obviouslybroken (test for equality with floating-point numbers)through the working-but-troublesome (circular dependen-cies among classes) to JUnit idioms and much more.

YOUR NEW HOMEWe’ve got the furniture in and the boxes unpacked—pizza-party time! (Actually, after cramming all these tools into myIDE, my living space feels distinctly overstuffed.) Your list ofthe best plug-ins may certainly differ from mine—in whichcase, we hope to hear from you—a good discussion willbenefit all of us. So why not drop us a line at [email protected] to get the discussion rolling? Enough withthe tools—back to the code!

26 | ECLIPSE REVIEW Fall 2006

Must-Have Plug-Ins

Figure 5 oXygen is a complete XML/XSL editing suite, with syntax highlighting, autocomplete, DTD and schema generation, and XSLT transforms.

Page 27: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Web services are rapidly becoming the most popu-lar form of integration. This is primarily due totheir interoperability with any language and plat-

form that communicates over HTTP and can manipulateXML. In addition, because it communicates over HTTP,which is commonly firewall-friendly, it’s operationallyeasier to use than previous remote invocation technolo-gies like CORBA, which required additional ports andprotocols.

Though it previously lacked native support for pro-ducing and consuming Web services, with last year’sintroduction of the Web Tools Platform, Eclipse nowincludes wizards and a Web Services DefinitionLanguage editor for generating Web service servers andclients, as well as server definitions for deploying Webservices and tools for testing Web services, includingWeb Service Explorer and TCP/IP.

Here, I’ll discuss a strategy for generating and pack-aging Web service clients using WTP, and how toinclude and use the Web service client in a simple Webapplication.

SAMPLE APPLICATION The sample application shown in Figure 1 (see page 28)is a simple dynamic Web page that a travel agent orcustomer might use to find information about a destina-tion based on zip code. The application uses two .NETWeb services found on the public Web services registryX Methods, located at www.xmethods.net.

The first Web service is the Weather Forecast serviceprovided by WebserviceX.NET. A service description isavailable at www.webservicex.net/WeatherForecast.asmx. Later on, we’ll use the GetWeatherByZipCodeservice to return a seven-day weather forecast as wellas place name, state code, latitude and longitude.

The second Web service is a Zip Code Informationservice provided by Ripe Development. A servicedescription is available at www.ripedev.com/testService.aspx. Here, you’ll use the zipCodeToAreaCode andzipCodeToTimeZone methods to return the area code

n BY CHRISTOPHER JUDD

SOAP? XML? WSDL?Java? Eclipse!

Leveraging Web Services Using the Web Tools Platform

Christopher Judd is president and primary consultant of JuddSolutions LLC. (www.juddsolutions.com). Co-author of “EnterpriseJava Development on a Budget” (Apress, 2003) and “Pro Eclipse JST”(Apress, 2005), he also serves as an industry speaker, open sourceevangelist and consultant in Java, J2EE, J2ME, Web services andrelated technologies.

Fall 2006 www.eclipsereview.com | 27

Page 28: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

and time zones, respec-tively.

WEB SERVICE CLIENTSTRATEGYUnderneath the covers,WTP 1.5 uses version 1.3of the popular Apache AxisWeb service frameworkfound at http://ws.apache.org/axis. To develop aWeb service client, WTPand Axis generate theclient-stub Java files basedon the WSDL, which is anXML document thatdescribes the Web serviceinterface. The WSDLincludes exposed service-method signatures, com-

plex data-type definitions and the URL in which toinvoke the service.

Figure 2 is a graphical representation of the WeatherForecast WSDL file using the WTP’s WSDL designer. TheWeatherForecastSoap service exposes the service methodsof GetWeatherByZipCode and GetWeatherByPlaceName.Drilling into the output of GetWeatherByZipCode revealsthe graphical presentation of the complex data typereturned by GetWeatherByZipCode.

As shown in Figure 3, GetWeatherByZipCode returnsa complex type of WeatherForecasts that contains attrib-utes of PlaceName, StateCode, Latitude, Longitude andDetails. This is an array of WeatherData types that con-tain the day and the URL to a weather map, as well as atemperature for each of the seven days in the forecast.

A common antipattern is to generate the Web serviceclient-stub code directly into an application. This is anantipattern because the generated classes often don’tmeet company code-quality and package-naming stan-dards, and require that at least a handful of files be ver-sion controlled and managed, although they’ll never bemodified. In addition, it reduces reuse, because eachapplication invoking the service must generate andmaintain its own copies of the same files.

An alternative best practice would be to treat the Webservice as you would a third-party library. In reality, it’sno different than a service provider giving you a JAR fileto invoke its service, except that you generate the JARfile yourself. In fact, it’s a good idea to include the origi-nal WSDL file and a readme.txt in the JAR with the gen-

erated class files. The readme.txt file should contain theversion of Axis used to generate the client code as wellas any other generating instructions. These additionalfiles provide traceability in case the service providerchanges the service interface or Axis version conflictsarise.

CREATING A WEB SERVICE CLIENT JARTo make a Web service client JAR, create a regular JavaProject per Web service. Then put the service’s WSDLfile in the root of the project. The WSDL file can oftenbe downloaded from the service provider’s Web site; ifyou can’t find it there, ask the service provider to e-mailit to you.

With the WSDL in your project, right-click on it andchoose Web Services > Generate Client to invoke theWeb Service Client wizard. Alternatively, you can useFile > New > Web Services > Web Service Client andenter a URL if you don’t want to include the WSDL inyour project.

Figure 4 shows the first step in the Web ServiceClient wizard. In the Service definition field, you canuse the browse button to select a WSDL file in yourworkspace, on the file system or a URL. In theory, theClient type field can be used to select a client type. Atthis time, WTP includes only a Java Proxy client type.

But in the future, this wizard could be extended to sup-port other client types—even a .NET client type.

Below the Client type is an innovative slider bar witha graphical representation for selecting how much WTPand Axis will generate. For a Web service client, theonly level that applies is the first level, Develop client.Selecting any other level will produce the same results:the Web service client proxy code. The only configura-tion to the right and below that applies to generatingthe client is Web service runtime; however, just like thelimited Client types at this time, the Web service run-time is currently limited to Axis.

The second page in the wizard prompts for an outputfolder using a drop-down box containing a list of Javasource directories. Here, the Java clients will be generat-ed. The wizard also enables the customization of name-space to package mapping if desired. If this option isselected, another page will be added to the wizard toenable mapping. By default, the wizard will use thetargetNamespace attribute in the wsdl:definitions ele-ment to create a Java package for the generated Javasource, but be forewarned—this often produces uglypackage names.

For example, the Zip Code Information service targetnamespace, http://ripedev.com/xsd/ZipCodeResults.xsd,

28 | ECLIPSE REVIEW Fall 2006

Web Tools Platform

Figure 1 Sampleapplication

Figure 2 Representation of the WeatherForecast WSDL

AN ALTERNATIVE BEST PRACTICE: TREATTHE WEB SERVICE AS YOU WOULD ATHIRD-PARTY COMPONENT OR LIBRARY.

Page 29: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

generates the unusual package name ofcom.ripedev.xsd.ZipCodeResults_xsd. Note that thispackage name breaks common Java package-namingconventions of using lowercase names and no under-scores. So, using the namespace to the package-mappingpage, you can generate the client stubs and complexdata types in more conventional package names. Thepage contains a table with two columns: The first con-tains the namespace in a HTTP URL format from theWSDL, and the second holds the Java package name itshould map to. Use the add button below the table toadd the desired mappings.

When the Weather Forecast Web service wizardwraps up, it generates specific files, as described inTable 1 (see page 30). In general, though, the wizardgenerates a service interface as well as a dynamic proxyand stub implementation. It also generates a servicelocator interface and implementation, and finally,JavaBeans/data transfer objects (DTO) for each of thecomplex types required by the Web service. These class-es will be further discussed in the “Using the WebService Client” section.

The Web Service Client wizard also adds the follow-ing Axis JARs to your project: axis.jar, commons-discov-ery-0.2.jar, jaxrpc.jar, saaj.jar, wsdl4j-1.5.1.jar and com-mons-logging-1.0.4.jar. This is important because theseJARs must be packaged with your application to use thegenerated Web service client.

Before packaging your Web service client JAR, makesure you create the aforementioned readme.txt file inyour project. In addition to the version of Axis, you mayalso want to include any namespace to package map-pings you might have performed.

To create the Web service client JAR file, use theEclipse export JAR functionality by right-clicking onyour project and selecting Export > Java > JAR file. Inthe JAR Export wizard, uncheck the .classpath and.project files to prevent them from being included in theJAR. In addition, select a name and location for theresulting JAR file. A good naming convention is adescriptive name followed by ws-client to indicate it’s aWeb service client. End the filename with a versionnumber to accommodate future changes made to theWeb service. An example filename for the WeatherForecast service is weatherforecast-ws-client-1.0.jar.

You may want to generate a source and JavaDoc JAR

for your Web service client to make debugging andusing the client easier.

Once the Web service client JAR has been created,you may delete the Eclipse Java project and generatedcode because you can always regenerate it if necessaryfrom the WSDL located in the JAR.

CONFIGURING WTP SERVERSBefore you can begin creating a Web application in yourworkspace to use the generated and packaged Web serv-ice client, configure a WTP server runtime for yourapplication server. Examples of server runtimes includeWeb container–only servers such as Apache Tomcatfound at http://tomcat.apache.org or a full-blown JEEapplication server such as Apache Geronimo, found athttp://geronimo.apache.org.

To create a server runtime configuration in yourworkspace, go to Window > Preferences > Server >Installed Runtime. Use the Add button to start the NewServer Runtime wizard. On the first page of the wizard,select your desired application server from the list ofavailable server runtime. Or, if you don’t see your pre-ferred application server, use the Don’t see your applica-tion server listed? link.

The second page of the New Server Runtime wizardis specific to the application server chosen on the previ-ous page. The Apache Tomcat 5.5 configuration is typi-cal of most server configurations, requiring a directorywhere the application server has been installed, as wellas a JRE to run the server.

Fall 2006 www.eclipsereview.com | 29

Web Tools Platform

Figure 3 Graphical representation of the WeatherForecast complex types

Figure 4 Select WSDL and client type step in Web Service Client wizard.

Page 30: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

WTP shouldn’t have any effect on your application’sruntime, so you won’t be required to deploy any WTPJARs with your application. That’s why Apache Axis isused as the Web service framework. Likewise, you mustinstall your application server separately and configurethe server runtime configuration to point to the directo-ry using the installation directory field.

Note: Most application servers require that a JDKincluding a tools.jar, not a JRE, be configured in the JREfield since a JDK is required to compile JSPs. Even ifyour application has no JSPs, most application serveradmin applications do, so it’s a good practice to use anappropriate JDK for your app server. If you haven’t con-figured one, use the Installed JREs button to do so.

CREATING A WEB APPLICATIONTo create a Web application, use WTP’s Dynamic WebProject wizard by selecting New > Project > Web >Dynamic Web Project. On the first page of the DynamicWeb Project wizard, provide a name and make sure theappropriate server configuration is selected in the TargetRuntime. The remaining page defaults are fine for a sim-ple Web application, so you can finish the wizard.

Upon completing the Dynamic Web Project, you areprompted to switch to the WTP J2EE perspective if youaren’t already in it. You’ll also have a new project containinga Java source directory of src, a build/classes directory forgenerated classes as well as a WebContent directory to con-tain Web artifacts defined by the Servlet specifications. TheWebContent/WEB-INF is aspecial directory that con-tains files that aren’t exter-nally addressable via HTTPwhen the application isdeployed. By default, it con-tains the required Web.xmldeployment descriptor and alib directory for jars yourapplication depends on.

USING THE WEB SERVICE CLIENTBefore writing the code toexecute the Web services,the Web service clientJARs and Axis JARs mustbe copied to the Webapplication’s WEB-INF/libdirectory so they’ll beincluded in the Web appli-cation’s class loader atruntime. In WTP 1.5, theAxis JARs axis.jar, com-mons-discovery-0.2.jar,jaxrpc.jar and saaj.jar canbe found in theeclipse/plugins/org.apache.axis_1.3.0.v200606181221 /lib directory, and com-mons-logging-1.0.4.jar can

be found in the eclipse /plugins/org.apache.commons_logging _1.0.4.v200606131651/lib directory. These URLsare likely to change as WTP releases new versions, so abetter method for determining the location of the AxisJARs is to look at the Web service client project JavaBuild Path properties.

Calling a Web service from an Axis-generated classclient proxy is a boilerplate three-step process, as shownin Listing 1. In the first step, you create an instance ofthe generated locator. In Listing 1, this is an instance ofWeatherForecastLocator.

Next, you look up the service instance using the loca-tor’s get method. The get method is overloaded toaccept a java.net.URL in case you need to call it at a dif-ferent URL than the default specified in the WSDL. Thisoften happens if you call different instances of the Webservice in test environments than and in production. Ifyou do this, make sure you externalize the URL and callthe getter that accepts a java.net.URL. The final step isto call the actual service method and get the resultsback.

The code shown in Listing 1 can be called by justabout any Java code that includes the Web service clientJARs and Axis JARs in its classpath. This includesServlets, Struts Actions, JSF, EJB, Swing, unit tests andeven command-line Java applications. Listing 2 demon-strates calling the Weather Forecast and Zip CodeInformation service from a JSP scriptlet of an index.jsppage created using the WTP JSP wizard.

30 | ECLIPSE REVIEW Fall 2006

Web Tools Platform

Listing 1 Calling the Weather Forecast Web service

// create locatorWeatherForecastLocator forcastLocator = new WeatherForecastLocator();// use locator to look up service classWeatherForecastSoap weatherForecastSoap = forcastLocator.getWeatherForecastSoap();// invoke service methodsWeatherForecasts forecasts = weatherForecastSoap.getWeatherByZipCode(zipCode);WeatherData[] details = forecasts.getDetails();

Table 1 Generated WeatherForecast service file descriptions

WeatherData.java

WeatherForecasts.java

WeatherForecastSoap.java

WeatherForecastSoapStub.java

WeatherForecastSoapProxy.java

WeatherForecast.java

WeatherForecastLocator.java

Data transfer object representing the WeatherData com-plex type shown in Figure 2.

Data transfer object representing the WeatherForecastscomplex type shown in Figure 2.

Service interface containing the getWeatherByZipCodeand getWeatherByPlaceName shown in Figure 1.

Stub Implementation of the WeatherForecastSoap inter-face.

Dynamic proxy implementation of theWeatherForecastSoap interface.

Service locator interface for looking up theWeatherForecastSoap implementation.

Implementation of the WeatherForecast interface.

Page 31: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

DEPLOYING A WEBAPPLICATIONThe easiest way to deployand test a Web application isto right-click on the Webproject and choose Run As> Run on Server. A Run onServer wizard will be invok-ed, prompting you to selecta server to run on. The sec-ond page of the wizard willlist of all the Web, EJB andEAR projects in your currentworkspace if your server is afull JEE server, or only Webprojects if your server is aWeb container. Moving theprojects from the Availableprojects list to the Con-figured projects list instructsWTP to deploy those appli-cations on server startup.When you click Finished,the server is started and theapplication is deployed.

Once the server is started,an internal Web browser willopen and navigate to yourWeb application. A serverconfiguration will also beadded to the Server view.which can be used to startand stop the server. TheServer view can also be usedto restart the server in debugmode, causing the debuggerto be invoked when it hitsbreakpoints in any Java fileor JSP.

And that’s it! Note thatWTP doesn’t provide anymore functionality for gener-ating Web service clientsthan is available using theApache Axis framework’scommand-line utilities orApache ANT tasks.However, its Apache Axisintegration and wizardsmake generating and pack-aging a Java Web serviceclient quicker and easier.

WTP also provides allthe features necessary tobuild, deploy and test JEEapplications that use theWeb service clients it gen-erates to consume andaggregate Web services.

Fall 2006 www.eclipsereview.com | 31

Web Tools Platform

Listing 2 Complete index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>

<%@page import="net.webservicex.weather.*"%><%@page import="com.ripedev.zipcode.*" %>

<%String zipCode = request.getParameter("zipCode");if (zipCode == null || "".equals(zipCode)) {

zipCode = "90210";}

// WeatherWeatherForecastLocator forcastLocator = new WeatherForecastLocator();WeatherForecastSoap weatherForecastSoap = forcastLocator.getWeatherForecastSoap();WeatherForecasts forecasts = weatherForecastSoap.getWeatherByZipCode(zipCode);WeatherData[] details = forecasts.getDetails();

pageContext.setAttribute("forecasts", forecasts);pageContext.setAttribute("details", details);pageContext.setAttribute("zipCode", zipCode);

// Zip CodeZipCodeLocator locator = new ZipCodeLocator();ZipCodeSoap zipCodeSoap = locator.getZipCodeSoap();Object areaCode = (Object)zipCodeSoap.zipCodeToAreaCode(zipCode)[0];String timeZone = (String)zipCodeSoap.zipCodeToTimeZone(zipCode)[0];

pageContext.setAttribute("areaCode", areaCode);pageContext.setAttribute("timeZone", timeZone);

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Travel Agent Zip Code Search</title></head><body>

<form action="index.jsp">Zip code: <input type="text" name="zipCode" value="${zipCode}"><input type="submit">

</form>

Place Names: ${forecasts.placeName}<br/>State Code: ${forecasts.stateCode}<br/>Area Code: ${areaCode}<br/>Time Zone: ${timeZone}<br/>Latitude: ${forecasts.latitude}<br/>Longitude: ${forecasts.longitude}<br/>Allocation Factor: ${forecasts.allocationFactor}<br/>FIPS Code: ${forecasts.fipsCode}<br/>

<p/> 7 Day Weather Forcast:<p/>

<table><c:forEach var="detail" items="${details}">

<tr><td>${detail.day}</td><td><img src="${detail.weatherImage}" /></td><td>

${detail.maxTemperatureF}&deg;F/${detail.minTemperatureF}&deg;F<br/>${detail.maxTemperatureC}&deg;C/${detail.minTemperatureC}&deg;C<br/>

</td></tr>

</c:forEach></table>

</body></html>

Page 32: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

32 | ECLIPSE REVIEW Fall 2006

As software becomes more complex, the probabilityof exposing end users to program defects increasesexponentially. While it was once possible to modify

code and stage a code review with fellow developers,this scenario frequently misses key coding problems dueto inattention to the complexities of the code.

Today, with modern software projects typically com-prised of hundreds of classes and many thousands oflines of code, peer review no longer works. To helpresolve some of these weaknesses in the software devel-opment process, a range of static analysis tools hasevolved that automatically detect and often correct com-mon problems in the source code.

The Eclipse Test and Performance Tools Platform hasstatic analysis capabilities in addition to its well-knownprofiling and runtime testing features. You can useTPTP’s static analysis framework for performing auto-matic code review for Java and C++ code. It’s also acomplete API for developing additional custom rules,data reporting and even entirely designing your ownnew forms of analysis. Let’s see how it works. But first,let’s talk about the biggest question: Why?

WHY USE STATIC ANALYSIS?The real question to ask is “Why not?” Using staticanalysis tools is the easiest path to writing better code.Among many other studies over the past two decades, a2005 IBM coding practice survey, both internally and ofIBM Global Services customers, suggests that staticanalysis tools can help find 5 to 15 percent of all appli-cation defects—and some empirical studies even claimresults as high as 30 percent. Regardless of the quantifi-cation of the results, one measure is certain: The earliera problem is detected in the development cycle, thecheaper it is to correct.

If you’ve ever enrolled in a software design course,you’re already familiar with the graph in Figure 1,which shows the exponential cost of bug fixing. If a bugis detected early, the cost is minuscule; however, findingand fixing a bug after customer deployment can cost

many thousands of dollars.The easiest way to achieve early detection and cor-

rection of defects is to apply automatic tools, and whatbetter tool than one that’s free?

INTRODUCING THE ECLIPSE TPTP STATIC TOOLSIn the vast static analysis landscape, you can choosefrom dozens of great commercial tools already available.

A quickInternet searchwill produce ahuge collectionof free toolsthat detectmany codingproblems. Sowhy do youneed another?

The basicproblem withall static analy-sis tools (and

software tools in general) is that they all look different—and act differently. For example, the workflow forParasoft’s Jtest product is quite different fromInstantiations’ CodePro AnalytiX, even though both ulti-mately accomplish the same task. The configurations ofrules and viewing of results are quite diverse betweenthese and other products. So while it’s common to use more than one tool, there is no consistent staticanalysis process.

n BY STEVE GÜTZ

Improving Code WithStatic Analysis

Take advantage of Eclipse’s testing tools

Steve Gütz is a senior software developer and team lead in IBMRational’s modeling tools group. He has been a committer on the Test& Performance Tools Platform for the past two years. Previously, heheld senior management and executive positions in several publicand private companies, including two of his own successful start-ups.

Figure 1 Defect repair costs

Page 33: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Additionally, among tools, the rule APIs, dataexporting and reporting (if theses feature exist at all)are diverse.

When developing the static analysis tool for TPTP,the development team had two maingoals. First, they wanted to make allforms of static analysis consistentfor the user by offering a commonuser interface and configurationprocess. They also wanted to pro-vide a consistent and common APIfor static analysis tool developers toextend the framework.

Both of these themes are prevalentthroughout this article, so let’s getstarted by installing TPTP’s staticanalysis capabilities into the EclipseWorkbench.

As noted, TPTP’s best feature is,of course, its price—free! You can install it seamlesslyinto the Eclipse IDE or almost any tool derived from theEclipse platform. Users will benefit from the rich collec-tion of code review rules for Java and C++, whiledevelopers can adopt the API to easily extend the ruleset to enhance TPTP’s code review capabilities or toenforce internal corporate coding conventions.

GETTING STARTED WITH TPTP AND STATIC ANALYSISWhether you’re a developer or end user, to get startedwith TPTP static analysis you must meet a few require-ments. First, you need an Eclipse IDE, and the easiestway to obtain this is by installing the platform’s fullCallisto release. Note that you can also build up anEclipse environment from component pieces, but this ismore challenging. Regardless of which installationmethod you choose, you’ll find the tools you need at theEclipse Web site (see the list of resources at the end ofthis article). You’ll need:

• The base Eclipse 3.2 platform• Java support (JDT)• C++ support (CDT) if you plan

to analyze C/C++code• TPTP 4.2 platform or later

(you’ll use a TPTP 4.3 build forthis article)

If you choose to use Callisto, youcan select and install almost every-thing you need, including the Javadevelopment tools; however, if youplan to analyze C or C++ code,you need to download the TPTPC++ Code Review componentsfrom the Eclipse TPTP Web site—atthis point, these components are still in a technical pre-view state.

Once you have an environment set up and Eclipse isstarted, you’ll notice a couple of new user interface ele-ments. TPTP static analysis adds new toolbar items tothe Eclipse Workbench, and you’ll also see some new

options available from the Eclipse Run… menu. To use the static analysis tool, you must create one or

more analysis configurations, which are simply lists ofrules you want to apply to your source code. You can

have as many configurations as youlike and can use them from manyplaces in the Eclipse user interface,such as the main toolbar and menu,the Package Explorer or even withinan editor.

Building an analysis configurationis easy. From the Run… menu,select the Analysis… option, and themain configuration dialog willappear. This window closely resem-bles the configuration dialogs forrunning and debugging applicationsin Eclipse. Select the Analysis entryin the left side of the window and

create a new configuration using either the Toolbar but-ton or context menu in the dialog.

Once a new configuration has been created, the rightside of the dialog will display a tab folder with two tabs.The first, the Scope tab, is used to determine the defaultrange of resources over which analysis will occur. Notethat the values set in this tab are only a guideline andcan be overridden by the user depending on the locationwhere static analysis is invoked in the Eclipse userinterface. The scope selected in this tab is used onlywhen the user starts static analysis from the main menuor toolbar. For now, leave the scope selection at itsdefault value: the entire workspace.

The second tab in the static analysis configurationdialog, the Rules tab, provides functionality for selectingdifferent kinds of analysis and rules. The rule list is pre-sented as a tree where the top-level nodes represent theanalysis provider (for example, types of analysis) andthe deepest nodes represent rules. All the nodes inbetween are rule categories, which are simply groupings

of rules and categories that match aparticular characteristic. Click theCode Review for Java analysisprovider checkbox to select all rulesfor Java code.

When the rules and scope areconfigured, click the Analyze buttonto begin the code review process. Ifnot already visible, an AnalysisResults view will appear, displayinga historical list of each analysis thathas been performed.

Congratulations! Your first auto-matic code review is now complete,

and you can browse the results that have been reported,view highlighted problems in a Java editor, or, in manycases, perform an automatic quick fix.

One other aspect of TPTP’s static analysis feature isthe ability to run multiple forms of analysis at the sametime. This capacity is unique in the static analysis mar-

Figure 2 Static analysis in the Eclipse Workbench

Fall 2006 www.eclipsereview.com | 33

Static Analysis

Figure 3 The static analysis launch configuration

Page 34: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

34 | ECLIPSE REVIEW Fall 2006

Static Analysis

ketplace. Most commercial vendors would be happy tosell you a different tool for Java code review or metrics,or similar tools for C++ or other languages.

Aside from the multiplied costs of owning several dif-ferent tools, usability issues often arise, since each toolprobably functions differently. With TPTP, you can sim-ply select multiple analysis providers when the configu-ration is created, and a single analysis process can testcode for both languages.

WHAT’S IT GOOD FOR?Now that you’ve got a list of static analysis results, whatshould you do with it? Obviously, you’ll want to fix anyproblems you find, but first, you need to understandwhat the code review is reporting. Let’s look at a simplecode example. Suppose you have a method like the oneshown here:

public String[] getList( boolean flag ) {if( flag ) {

String[] list = new String[3];list[0] = “one”;list[1] = “two”;list[2] = “three”;

return list;}return null;

}

When you run Java code review on a class containingthis example, you’ll get the following analysis result forthe method:

Avoid returning null instead of empty arraySo what’s the problem? Well, assume this method is

used as it is in the following fragment:

for( int i = 0; i <getList(flag).length; i++ ) {

// Do stuff}

Now do you see the problem? What happens ifgetList() returns null? The for loop will generate aNullPointerException, and the application will fail. If theflag that controls the method is invoked by a rarely usedfeature in your product, a basic JUnit test may not findthis problem during development.

While this example is trivial, it highlights a commoncoding practice that often goes unchecked: The subtleproblems that could be found easily by a basic automat-ed code review typically evade detection until your

product has reached a customer. With TPTP’s staticanalysis tools, you can find this sort of bug in seconds,early in the development cycle when it costs almostnothing to fix.

TPTP currently supports more than 70 Java codereview rules (43 C++ rules) to detect many commonprogramming problems. Of course, not every problemreported is serious. You’ll find code review results divid-ed into one of three severities (Severe, Warning,Recommendation), but regardless of severity, the issuesreported are worthy of investigation and correction. Sowhy would you not run TPTP’s code review? It’s easy toset up and can quickly examine even large workspacesto find problems that developers commonly create. Bestof all, you can download code review for no cost.

DEVELOPING FOR STATIC ANALYSISEventually, the rule sets available with TPTP will showtheir limits. For example, suppose you have an internalAPI for which enforcement rules are needed. Many ofthe other free and open source alternatives to TPTPoffer no extensibility or restrictive, confusing APIs. Mostcommercial analysis tools provide rich APIs, but theseproducts can be cost-prohibitive. TPTP offers a bettersolution because its code review framework is both cost-effective and simple to extend. New rules can be createdfrom existing templates or can be constructed as Javaclasses within an Eclipse plug-in. In either case, TPTPoffers you the opportunity to use the power of theEclipse editing and debugging facilities to create newrules.

TPTP’s static analysis framework offers a number ofkey extension points; however, when writing new rules,only a few of these are needed. The following table listsall of the extension points defined for static analysis use—note that all extension points are in the org.eclipse.tptp.platform.analysis.core namespace.

SETTING UP A PLUG-IN FOR NEW RULES AND CATEGORIESThe confines of this article prevent a detailed descrip-tion of rule plug-in set-up; however, you can find adetailed tutorial on the TPTP Web site (see theresources at the end of this article). To define thisprocess in its simplest form, take the following steps:

1. Create a new plug-in project in your Eclipse work-space.

2. Add the following plug-in dependencies to the project:

a. org.eclipse.core.runtimeb. org.eclipse.jdt.corec. org.eclipse.tptp.platform.analysis.cored. org.eclipse.tptp.platform.analysis.codereview

.java3. Define your new categories and rules.Creating New Categories. If you have the source

code for TPTP’s Java code review rules installed, openthe plugin.xml file and you’ll see the analysisCategoryextensions that define all of the categories used in TPTP

Figure 4 The static analysis results

Page 35: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

(See Listing 1).Let’s take a closer look.

First, notice that the classfield of each categorypoints to theDefaultAnalysis Categoryclass, which is supplied bythe TPTP static analysisframework to provide acomplete and commonlyused class for categories.While it’s possible to cre-ate your own categoryclass, the default behaviorshould be the preferredway to supply this func-tionality.

Category extensionsalso declare an id fieldthat should contain aunique identifier for thecategory. Colliding withidentifiers defined by othercategories usually pro-duces undesirable effectssince the framework willbe unable to distinguishone category from another.

One final subtlety of thecategory extensions is theuse of the provider andcategory fields. Thesemutually exclusive fieldsdefine where in the analy-sis hierarchy the categorywill be situated. If theprovider field is used, thecategory is defined as atop-level category, whiledefining the category fieldwill cause the new catego-ry to be contained within another category. In eithercase, the value of these fields is the unique identifier ofthe owing provider or category, respectively. Note thatyour new category can be placed within an existing cat-egory defined by TPTP’s Java code review simply byusing the correct identifier (you can find these identi-fiers in the plugin.xml of the Java rules plug-in).

Creating New Rules. Defining your own rules is atwo-step process. First, create a rule class. Then, define anextension to map the rule class into the TPTP static analy-sis space.

While a detailed description of rule creation isbeyond the scope of this article, a high-level view canbe offered to help convey the concepts you willencounter. For a more detailed discussion of Java codereview rules, refer to the tutorials on the TPTP Web site.

When you’re creating rule classes, the TPTP staticanalysis framework goes a long way toward simplifying

the task for you. If you always extend theAbstractAnalysisRule class, your job is half finished.This abstract class provides all of the common function-ality needed by every rule, and all you really need to dois implement your own worker method to set the rulecriteria.

For the example, here you’ll create a rule that generates results anytime the Thread.stop() method isused. In basic terms, you want to parse all the sourcecode and look for classes that extend java.lang.Threadand call stop(). Listing 2 shows an implementation forthis rule.

Notice that in Listing 2, the class extends the recom-mended AbstractAnalysisRule class, which requires it toimplement an analyze() method. The first step this rule(and all Java code review rules) takes is to acquireinformation about the Java file being analyzed. You dothis by obtaining the CodeReviewResource instance from

Table 1 Extension points defined for static analysis use (note that all are in theorg.eclipse.tptp.platform.analysis.core namespace)

Extension Point

analysisProvider

analysisCategory

analysisRule

analysisRuleQuickFix

analysisRuleTemplate

analysisRuleSet

analysisViewer

analysisExport

Description

Provisions a new type of analysis into the TPTP static analysisframework. Analysis providers are the engines that control theparsing of source and execution of rules.

Defines new analysis categories. These can be owned by ananalysis provider or by other categories.

Defines a new analysis rule. Rules are the workhorses of staticanalysis, responsible for executing on defined criteria and gener-ating results when those criteria are met (or not met).

Defines a process used to correct the results of rules. Quick fixesusually encapsulate a refactoring class that manipulates sourcecode directly to eliminate the cause of a generated analysisresult.

Think of rule templates as unfinished rules. Templates can be usedto create a skeleton for a repetitive rule and provide fields thatcan be filled in by either a developer or end user to create newrules.

Rule sets are used to define a quick selection set of rules. Forexample, a rule set could easily be created that selects all rulesdefined in Joshua Block’s “Effective Java” (Addison-Wesley,2001).

Analysis viewers are used to examine the domain-specific resultsof an analysis. Viewers can take any form that fits the presenta-tion of data (for example, tree, table, diagram).

An analysis exporter is used to define a format for exportingresult data. Defined exporters appear as selectable user interfaceitems when the end user chooses to export data from an analysisprovider.

Fall 2006 www.eclipsereview.com | 35

Static Analysis

Page 36: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

the analysis provider, as shown in the example rule.At this point, you can take one of two paths to imple-

ment your rule. First, you can use any of the JDT APIsimplemented in the Eclipse platform, or you can use thesimplified API supplied by the TPTP analysis frame-work—the latter is streamlined for handling code reviewqueries and generating results, so the AvoidThreadStopexample will take this approach.

After determining the resource being analyzed, thecode next acquires a list of method invocations from theresource, then calls the ASTHelper.satisfy() method.This method filters out data that doesn’t fit the filter cri-teria. In our example, the code uses the MIFILTER arrayto discard any method invocations for methods notdefined in the java.lang.Thread class and to subsequent-ly discard any methods that are not calls to stop(). Whatremains is a list of calls to Thread.stop().

Since this rule is trivial, our work is finished. In thiscase, any method invocations remaining in the list areconsidered violations of the rule, so thegenerateResultsForASTNodes() method is called to createresults for each of them.

Finally, the Java class being reviewed could be onethat extends java.lang.Thread, so you need to take onemore step to check any super method invocations forthe same Thread.stop() criteria and create results forthose, as well.

With the rule class created, only one easy stepremains. The rule needs to be integrated into the staticanalysis code-review structure so it is available andselectable by the user. To do this, create a simple exten-sion in the plugin.xml as follows:

<extensionpoint=”org.eclipse.tptp.platform.analysis.core.analysisRule”><analysisRule

category=”codereview.java.category.threads”class=”com.mycompany.rules.AvoidThreadStop”id=”myrules.java.threads.stop”label=”Avoid using Thread.stop()”

severity=”2”/></extension>

Notice that the category identifier for your rule speci-fies one that already exists in TPTP. This will plug therule into the existing TPTP Threads category. When youstart a runtime workbench containing your rule plug-in,the analysis launch configuration dialog should containyour new rule.

IT’S ONLY THE BEGINNINGIn a short article like this one, it’s difficult to providecomprehensive details of a complex subject like staticanalysis; however, you’ve gone through some of thebasic concepts of the TPTP framework. You should nowhave at least a cursory understanding of how to use thestatic analysis component from an end-user perspective,and if you’re a developer, you should have a footing inplace to help create your own rules.

If you’re interested in a complete step-by-step proce-dure for creating your own rules, refer to the TPTP Website, where you’ll find several articles discussing rules aswell as more advanced topics not covered here.

Keep in mind that TPTP is an open source project tohelp the entire community, so if you develop some inter-esting rules or integrate a new type of static analysisprovider, by all means submit them to the project sothat everyone can benefit.

RESOURCESn Eclipse www.eclipse.orgn TPTP www.eclipse.org/tptpn TPTP Static Analysis Tutorial Part 1 – A Consistent Analysis Interface, Steve Gütz and Orlando Marquez, 2006,

www.eclipse.org/tptp/home/documents/process/development/static_analysis/TPTP_static_analysis_tutorial_part1.html

n TPTP Static Analysis Tutorial Part 2 – Enhancing Java Code Review, Steve Gütz and Orlando Marquez, 2006,www.eclipse.org/tptp/home/documents/process/development/static_analysis/TPTP_static_analysis_tutorial_part2.html

n TPTP Static Analysis Tutorial Part 3 – Integrating Your Own Analysis, Steve Gütz, 2006,www.eclipse.org/tptp/home/documents/process/development/static_analysis/TPTP_static_analysis_tutorial_part3.html

n “Java and Static Analysis,” Amit Chaturvedi, Dr. Dobb’s Journal, June 2005, www.ddj.com/184406143

36 | ECLIPSE REVIEW Fall 2006

Static Analysis

Listingsn LISTING 1JAVA CODE REVIEW CATEGORIES

<extension point=”org.eclipse.tptp.platform.analysis.core.analysisCategory”>

<analysisCategoryclass=”org.eclipse.tptp.platform.analysis.core.category.DefaultAnalysisCategory”id=”codereview.java.j2sebestpractices”label=”%label.category.j2sebestpractices”provider=”codereview.java.analysisProvider”help=”org.eclipse.tptp.platform.analysis.codereview.java.rules.j2sebestpractices”/>

<analysisCategoryclass=”org.eclipse.tptp.platform.analysis.core.category.DefaultAnalysisCategory”id=”codereview.java.category.awt”label=”%label.category.j2sebestpractices.awt” category=”codereview.java.j2sebestpractices”

help=”org.eclipse.tptp.platform.analysis.codereview.java.rules.awt”/>...</extension>

Page 37: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Static Analysis

Listingsn LISTING 2AVOIDTHREADSTOP CLASSESpublic class AvoidThreadStop

extends AbstractAnalysisRule{

private static final IRuleFilter[] MIFILTER = {new DeclaringClassRuleFilter( “java.lang.Thread”, true ),new MethodNameRuleFilter( “stop”, true )

};

/*** Analyze this rule* * @param history A reference to the history record for this analysis*/

public void analyze( AnalysisHistory history) {// Extract the resource being analyzedCodeReviewResource resource = (CodeReviewResource)getProvider()

.getProperty( history.getHistoryId(), CodeReviewProvider.RESOURCE_PROPERTY );

// Find matched in method invocationsList list = resource.getTypedNodeList( resource.getResourceCompUnit(),

ASTNode.METHOD_INVOCATION );ASTHelper.satisfy( list, MIFILTER );resource.generateResultsForASTNodes( this, history.getHistoryId(), list );

// Find matched in super method invocationslist = resource.getTypedNodeList( resource.getResourceCompUnit(),

ASTNode.SUPER_METHOD_INVOCATION );ASTHelper.satisfy( list, MIFILTER );resource.generateResultsForASTNodes( this, history.getHistoryId(), list );

}}

Fall 2006 www.eclipsereview.com | 37

Page 38: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

38 | ECLIPSE REVIEW Fall 2006

We’re headed toward an era of dynamic richInternet applications for the enterprise. Even inthe face of heated debate about these types of

applications and exactly where companies are on theadoption curve, it’s clear that more and more enterprisesare building them.

I believe that rich Internet applications are superior tostandard Web applications. As human beings, we tend tobuy, use or pursue the “better” in daily life—and Webapplications are no different. Consumers and enterpriseswill want to use rich Internet applications, and businessesmust offer such applications, simply because they aresuperior—and if you don’t offer them, someone else will.

You can build rich Internet applications withAsynchronous JavaScript and XML, and you can buildAJAX applications with JavaServer Faces. JSF is a stan-dard, user interface component–based framework forbuilding Java-based Web applications—with the emphasison component-based.

The component approach is what gives JSF its powerand allows exploitation of AJAX. With JSF, you don’t thinkin terms of markup, like HTML, any more. Rather, the par-adigm is development with user interface components.

COMPONENT CONSCIOUSNESSA JSF user-interface component has renderers for compo-nent markup. These are simply Java classes that knowhow to generate all the necessary markup (read: HTML)for a UI component. Just keep in mind that JSF is allabout creating powerful UIs. Java is excellent for the backend, but it was always missing something on the UIside—and that’s exactly what JSF provides.

For application developers, it’s natural to think in termsof user interface components. A component can be assimple as the familiar input text field to a sophisticatedcomponent such as a tree or a tabbed panel. As a devel-oper, you design the application from your reusable userinterface components—if you use Swing or ASP.NET, youshould find this approach familiar. Both technologies uti-lize components to create user interfaces. In fact, I like to

think of JSF as bringing Swing-style development to theWeb—building Web applications out of UI components.

If you’re not sure what I’m talking about, I’ll approachit a bit differently. In the JSP world—to print a collectionof records of some sort, you put <table>..</table>HTML tags, create some sort of loop in Java, and put<tr><td>..</td>..</tr> tags inside the loop. Inside,you could have if statements to do something extra. Thisis the markup approach; it works, but with JSF this isdone a lot simpler. You take a ready-to-use component,like dataTable, and bind it to the same collection ofrecords. The component will then render all of the neces-sary markup and data for you.

A WIDER VIEWLet’s zoom out and look at this at a broader level. Ifyou’ve ever seen an assembly line for cars on TV, youwould see a door, for example, being attached to a car.Now, think of the door as a ready-to-use componentthat’s being attached to car. You don’t see engineersbuilding the door on the assembly line. Similarly, withJSF, you create Web applications out of reusable JSFcomponents. There’s no need for an application devel-oper to create the table component just before he uses itin an application.

You can find hundreds of JSF resources on the Web. Toget started or learn more, try www.jsfcentral.com, anexcellent site with a lot of news and resources. Anothersite, www.jsftutorials.net, can help you get started. Towork with JSF, all you need is Notepad or any other text-based editor, though there are commercial tools that canhelp make it easier.

But all this is less important than the plain fact that JSF

n BY MAX KATZ

Rich Internet Development: AJAX Meets JavaServer Faces

Component-based development for Web 2.0

Max Katz is a senior systems engineer at Exadel in technical sup-port, training and customer care for the Exadel product line, and alsoconducts online and onsite JavaServer Faces training.

Page 39: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

is the only standard Webcomponent technology forJava. By contrast,JavaServer Pages, portletsand servlets are standard,but aren’t component-based, and the Struts frame-work is neither component-based nor standard. Did wemention huge industry sup-port? Certainly nobodywants to stay with a big,important application based on a funky open-sourceframework that was invented and developed by oneclever programmer! This is why IBM, Oracle, Sun andothers are cultivating JSF, carefully selecting the bestideas for Web development and paying big money to thebest architects and developers to improve JSF for therest of us.

JSF’s position as a standard is doubly importantbecause it allows JSF to fully realize its promise as acomponent-based framework. The chances that compo-nents from different vendors will coexist in the sameapplication are much better when the technology ismore standardized—a great boon for all enterprise appli-cations developers!

Another interesting facet of JSF is that it’s a frame-work for both application developers and componentdevelopers. Applications developers build Web applica-tions out of JSF user interface components, while com-ponent developers build such components with JSF.

RICH INTERNET APPLICATIONSLook at Google Maps. The application feels a little differ-ent than what we’re used to on the Web with the sub-mit-and-wait experience. We get to a page, enter someinformation and click submit. Then, we wait for a reply.It’s pretty much unchanged since 1994, the early days ofthe Web. But let’s go back to Google Maps. The applica-tion feels fast; we don’t need to wait for it to reload orrefresh. It almost feels like we’re running a desktopapplication.

Google introduced Google Maps as one of the firsttruly rich applications, laying the groundwork for therise of AJAX as a technique for creating rich applica-tions. AJAX allows us to refresh or update only a part ofa page, instead of submitting a whole page every time.That’s why the applications feel fast, rich and interac-tive. With AJAX, you can update only the small part ofthe page that actually needs to be updated, but don’tupdate the parts that stay the same.

AJAX itself is not a framework, but a combination ofexisting technologies such as DHTML, JavaScript,XMLHttpRequest and DOM (Document Object Model).You can find numerous AJAX resources on the Web thatwill show and explain the underlying technologies inmore detail.

AJAX lets you create rich Internet applications.However, it’s not the easiest technology to use. AJAX

requires a deep understand-ing of the underlying tech-nologies, such asJavaScript. In other words,creating sophisticated Webapplications with AJAXtechnology is challengingand requires experts. It’snot uncommon to spend80–90 percent of develop-ment time battlingJavaScript incompatibilities

among Web browsers and platforms.

COMBINING JSF WITH AJAXWe know that JSF is a good component-based technolo-gy for building enterprise Web applications. We alsonow know that AJAX lets us create rich, fast and inter-active Web applications. What if you combine the twotechnologies to add some “richness” to JSF? If you usethe two technologies together, take a very powerful userinterface component frame and add AJAX functionality,you can build rich enterprise Internet applications.

Above, I said that AJAX could get complicated prettyfast. That’s still correct. However, because of JSF’s com-ponent architecture, you can easily use AJAX. How? Youcreate JSF components that render all the necessaryJavaScript, HTML and XML. You then simply use JSFAJAX-enabled components as out-of-the-box buildingblocks. This way, you can build rich Internet applica-tions with JSF and AJAX without writing a single line of

JavaScript—all the complexity of AJAX is hidden. This is exactly what I meant by saying that JSF is the

perfect match for AJAX. A simple JSF component suchas an input field knows how to render its entire requiredcoding. In the same way, a JSF component can send anAJAX request to the server after some event (such asonkeyup) and then update only a part of a page after aresponse is sent back. In this case, the component willalso know everything about how to render all the neces-sary JavaScript and HTML for itself.

The point that I’m trying to make here is this: JSFcomponents render markup. For an application develop-er, it’s not important what’s rendered, simple HTML orcomplicated JavaScript. The development style remainsthe same: building Web applications out of JSF compo-nents. Using AJAX to make applications interactiveshouldn’t change your development approach or jumpoutside the JSF component model; you simply continuebuilding Web applications out of reusable JSF compo-nents.

Figure 1 How the page looks with typical JSF validation

AJAX4JSF LETS YOU SEND AN AJAXREQUEST AND SPECIFY WHICH AREAS OFTHE PAGE SHOULD BE UPDATED.

Fall 2006 www.eclipsereview.com | 39

JSF and AJAX

Page 40: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

IMPLEMENTING THE IDEANow get a little bit more concrete and see what match-making tools are available to put JSF and AJAX in synch. Ajax4jsf (http://ajax4jsf.dev.java.net) is an open sourceframework that does just that. It brings AJAX functional-ity to JSF in the form of a JSF component library. Withthis framework, using just JSF components can addAJAX features to an existing or new JSF application.Because Ajax4jsf provides standard JSF components, it’sa natural extension to JSF. The framework is based onJSF standards, provides an open architecture and allowsmixing and matching with any other JSF componentlibrary, free or commercial.

The best way to show any technology is through aneasy example, and that’s exactly what you’re going to dohere. You’ll take a very simple JSF application and addAJAX functionality to it.

A SAMPLE APPLICATIONBefore you start, plan what you’re going to do. Imaginea registration page on the Internet with 10 or morefields. You start entering all the information. Whendone, you click submit (remember, submit-and-wait).You get the same page back and realize that four of thefields have incorrect information. Whoops. So, you cor-rect and resubmit the page. Wouldn’t it be much betterif you could get some feedback as you typed in the val-ues—some kind of live validation, similar to desktopapplications? That’s exactly what you’re going to dowith your application—you’ll add live validation. As youtype, you’ll get instant feedback about the correctness ofthe value.

APPLICATION BEFORE AJAXNow it’s time to check out a sample application:Download it at http://webdownload.exadel.com/misc/eclipsereview/a4j-validation.zip.

Open the project in your favorite IDE, and you’ll see astandard JSF page, with one input field with an attachedvalidator. If the value entered is shorter than three charac-ters long, an error message will be displayed. Of course,you first need to hit Submit for validation to happen. Keepin mind that this is just a standard JSF page.

ADDING AJAXTo improve this, the moment you’re typing and see thatthe value is incorrect, you want an error message shownwithout having to click Submit. Use the Ajax4jsf compo-nent library to add this AJAX feature to your application.Here’s what needs to be done.

1. Download the Ajax4jsf framework. 2. Copy the files, ajax4jsf.jar and oscache-2.2.jar, into

the WEB-INF/lib folder of your application.3. Register Ajax4jsf in the web.xml file:

<filter><display-name>Ajax4jsf Filter</display-name><filter-name>ajax4jsf</filter-name><filter-class>org.ajax4jsf.Filter</filter-class>

</filter><filter-mapping>

<filter-name>ajax4jsf</filter-name><servlet-name>Faces Servlet</servlet-name><dispatcher>REQUEST</dispatcher><dispatcher>FORWARD</dispatcher><dispatcher>INCLUDE</dispatcher>

</filter-mapping>

That’s it. In your actual application, you need to make three

small changes. (You can also just download the finishedapplication here: http://webdownload.exadel.com/misc/eclipsereview/a4j-validation-complete.zip.)

1. Add a taglib declaration for Ajax4jsf, a standard stepfor adding any new custom tag library.

2. Add an <a4j:support event=”onkeyup” reRender=”msg”> component inside <h:inputText> as achild element. This enables the sending of an AJAXrequest to the server as the user types. In otherwords, each time a letter is typed, an AJAX requestis sent to the server. (You can modify the frequencyof updates.) The request goes through the standardJSF page life cycle. This is not a client error message;you’ve invoked the standard JSF validator in thisexample. The reRender attribute will point to anAJAX area (see next step) that you need to re-render(update) as you send an AJAX request.

3. Enclose an <h:message/> component inside an<a4j:outputPanel id=”msg”> component to makeit part of an AJAX area. You need it to be in anAJAX area because you want the dynamic error mes-sage to be displayed or cleared from just this areawithout having to hit Submit and update the wholepage.

That’s all you need to do. In this example, you’ve added AJAX functionality by

simply using JSF components. You didn’t change yourdevelopment approach of just using JSF components; theresult is still just a standard JSF page. You didn’t have tomake any changes to any other parts of the application,like the configuration file or the managed bean. Youinvoked the standard JSF page life cycle to validate input.That’s how simple it is.

How does it work? Ajax4jsf lets you send an AJAXrequest and then specify which components (areas) onthe page to update. Keep in mind that you can updatemultiple components (areas) at once.

For example, consider a suggestion-box componentwith AJAX. As you start typing into it, the componentshows a suggested list of values. You can place any num-ber of suggestion-box components on a page, but none ofthem are able to update any other components on a page.So basically, all the AJAX functionally is “enclosed” with-in the component. That’s a component-level approach.However, for sophisticated applications, you must be ableto specify which components (areas) need to be updatedbased on some events—page-wide AJAX support—andthat’s exactly what Ajax4jsf provides.

Don’t get me wrong: The component-centric approachcan still be used when appropriate. In fact, combining thetwo approaches will give you the ability to create trulypowerful rich Internet applications with JSF and AJAX.

JSF and AJAX

40 | ECLIPSE REVIEW Fall 2006

Page 41: 27 Must-Have Eclipse Plug-Inspeople.cs.ksu.edu/~hankley/d501/Notes/2.JBuilder/eclipsereview_200612.pdfand Workspace concept for building images and managing projects, and provides

Company Buster—OrCompany Booster?

On the other hand, a vastly morepositive perspective is possible. Bythis reading, the existing tools com-panies were all exhausted, unprof-itable hulks that lived in daily fearof the monster from Redmond. Therelease of the Eclipse frameworkrevivified the existing non-Microsoftplayers, allowing them to emerge ina new form with higher long-termpotential.

As one might expect, my view-point leans toward the latter inter-pretation. The tools business hasalways been a difficult one.Microsoft has done an excellent jobin creating a tools/applications/serv-er ecosystem for which their solu-tions are always the best-tuned forthe environment.

With a significant portion of theoverall market residing onMicrosoft’s plate, that left smallerportions for the rest of the toolsindustry. Given the widespreadavailability of free tools, sellingdevelopment tools is a rough job.

While it’s tempting to think thatpeople will prefer commercial prod-ucts to “inferior” free ones, my

experience is different. I was onceconsulting to a tools company thatprovided a high-end, extremelycapable product. Their tool madeprogrammers more productive, noquestion about it—but they weren’tgetting the sales they wanted. So Iinterviewed a few end users tounderstand the tool decision-makingprocess, and, boy, were my eyesopened about the Power of Free.

One woman I spoke with aboutJava development efforts told methat the company didn’t have thebudget to purchase fancy tools. Itherefore asked her what they diduse to do their Java development. I expected to hear something likeemacs or even vi. Her response:Notepad. (I guess I’d have to putthat organization into the Microsoftcamp—although one wonders aboutthe quality of code her organizationturned out.)

So, for organizations like thatone, Eclipse presents a real opportu-nity to move to state-of-the-art toolswithin a constrained budget. Theycan achieve higher productivity,faster time-to-market, better abilityto recruit and retain skilled employ-ees, and a more satisfied workforce.(Nobody could be happy program-ming Java in Notepad!)

Just as important, however, is the

tool-developer side of the equation.While it’s tempting to paint Eclipseas a company buster, I believe it’sexactly the opposite—it’s a companybooster.

ECLIPSE OFFERS THE OOOMPHJust as a booster rocket supplies ini-tial thrust for a rocket-borne pay-load, Eclipse provides a tremendousamount of oomph for tools. Insteadof having to create an entire frame-work within which to deliver a spe-cial functionality, a tools companycan rely on Eclipse to take care of alot of the heavy lifting—or perhapsheavy lift-off would be the rightmetaphor.

With the many projects in theEclipse Foundation providing thetechnological underpinnings, for-profit tools companies can operatemuch more leanly and in tighterfocus on their special area of expert-ise. Rather than having to fund,design, build and maintain a bunchof functionality that does nothing todifferentiate their “secret sauce,”tools providers can deliver a highlyconcentrated functionality payloadthat serves them in the market.

Far from ruining the commercialtools market, Eclipse has strength-ened it. If you take a look at theplug-ins on the Eclipse site, the vari-ety and specialized capability avail-able are simply amazing. It’s clearthat Eclipse is accomplishing itsjob—providing a framework toenable differentiated developmentfunctionality to find its way into thehands of developers throughout theworld.

If you talk to some people, you’ll hear that Eclipse hasruined the commercial development tools market. By this

way of thinking, a free product has ruined the business prospects ofdevelopment tools companies. Many people recount this nostalgical-ly, pining for the days of dozens of tools companies; to their minds,Eclipse is a scourge in the marketplace.

Bernard Golden is Chief Executive Officerof Navica (www.navicasoft.com), a SiliconValley consulting firm offering open sourcestrategy, implementation and trainingservices.

PERSPECTIVEThe Present and Future of Eclipse | by Bernard Golden

Fall 2006 www.eclipsereview.com | 41