13.07.2015 Views

JDJ 10-1.indd - sys-con.com's archive of magazines - SYS-CON Media

JDJ 10-1.indd - sys-con.com's archive of magazines - SYS-CON Media

JDJ 10-1.indd - sys-con.com's archive of magazines - SYS-CON Media

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VOTE FOR i-TECHNOLOGY’S TOP 20 PAGE 3No. 1 i-Technology Magazine in the WorldJANUARY 2005VOLUME:<strong>10</strong> ISSUE:1Toys or tools?RETAILERS PLEASE DISPLAYUNTIL MARCH 31, 2005PLUS...SOA Solutionswith J2EETranslation-BasedIntegrationSEE BROCHURE INSIDE!• Join Over 3,000 Developers• App Server Shoot-Out!• FREE J2EE Tutorial• <strong>JDJ</strong> Partner Pavilion• Seminars and Case Studies$1,000,000S<strong>of</strong>tware GiveawayPAGES 51–60February 15-17, 2005Hynes Convention CenterBoston, MAT H E W O R L D ’ S L E A D I N G i - T E C H N O L O G Y M A G A Z I N E W W W . S Y S - C O N . C O M / J D J


Editorial BoardDesktop Java Editor: Joe WinchesterCore and Internals Editor: Calvin AustinContributing Editor: Ajit SagarContributing Editor: Yakov FainContributing Editor: Bill RothContributing Editor: Bill DudneyContributing Editor: Michael YuanFounding Editor: Sean RhodyProductionProduction Consultant: Jim MorganAssociate Art Director: Tami Beatty-LimaExecutive Editor: Nancy ValentineAssociate Editors: Jamie MatusowGail SchultzAssistant Editors: Natalie ChartersSeta PapazianOnline Editor: Martin WezdeckiResearch Editor: Bahadir Karuv, PhDWriters in This IssueCalvin Austin, Paulo Caroli, Bruno Collet,Jeremy Geelan, Eric Giguère, Michael Havey,Alexander Krapf, Bahar Limaye, Warren MacEvoy,Peter V. Mikhalenko, Dave Parsons, Ken Sipe,Susan Vickers, Joe Winchester, Michael Juntao YuanTo submit a proposal for an article, go tohttp://grids.<strong>sys</strong>-<strong>con</strong>.com/proposalSubscriptionsFor subscriptions and requests for bulk orders, please send yourletters to Subscription Department:888 303-5282201 802-3012subscribe@<strong>sys</strong>-<strong>con</strong>.comCover Price: $5.99/issue. Domestic: $69.99/yr. (12 Issues)Canada/Mexico: $99.99/yr. Overseas: $99.99/yr. (U.S. Banks orMoney Orders) Back Issues: $<strong>10</strong>/ea. International $15/ea.Editorial Offices<strong>SYS</strong>-<strong>CON</strong> <strong>Media</strong>, 135 Chestnut Ridge Rd., Montvale, NJ 07645Telephone: 201 802-3000 Fax: 201 782-9638Java Developer’s Journal (ISSN#<strong>10</strong>87-6944) is published monthly(12 times a year) for $69.99 by <strong>SYS</strong>-<strong>CON</strong> Publications, Inc., 135Chestnut Ridge Road, Montvale, NJ 07645. Periodicals postagerates are paid at Montvale, NJ 07645 and additional mailing<strong>of</strong>fices. Postmaster: Send address changes to: Java Developer’sJournal, <strong>SYS</strong>-<strong>CON</strong> Publications, Inc., 135 Chestnut Ridge Road,Montvale, NJ 07645.©CopyrightCopyright © 2005 by <strong>SYS</strong>-<strong>CON</strong> Publications, Inc. All rights reserved. Nopart <strong>of</strong> this publication may be reproduced or transmitted inany form or by any means, electronic or mechanical, includingphotocopy or any information storage and retrieval <strong>sys</strong>tem, withoutwritten permission. For promotional reprints, <strong>con</strong>tact reprintcoordinator Kristin Kuhnle, kristin@<strong>sys</strong>-<strong>con</strong>.com. <strong>SYS</strong>-<strong>CON</strong> <strong>Media</strong> and<strong>SYS</strong>-<strong>CON</strong> Publications, Inc., reserve the right to revise, republish andauthorize its readers to use the articles submitted for publication.Worldwide Newsstand DistributionCurtis Circulation Company, New Milford, NJFor List Rental Information:Kevin Collopy: 845 731-2684, kevin.collopy@edithroman.comFrank Cipolla: 845 731-3832, frank.cipolla@epostdirect.comNewsstand Distribution ConsultantBrian J. Gregory/Gregory Associates/W.R.D.S.732 607-9941, BJGAssociates@cs.comJava and Java-based marks are trademarks or registeredtrademarks <strong>of</strong> Sun Micro<strong>sys</strong>tems, Inc., in the United States andother countries. <strong>SYS</strong>-<strong>CON</strong> Publications, Inc., is independent <strong>of</strong>Sun Micro<strong>sys</strong>tems, Inc. All brand and product names used onthese pages are trade names, service marks or trademarks <strong>of</strong>their respective companies.From the Group Publisheri-Technology’sAll-Time Top <strong>10</strong>0?No sooner had we begun our readerdrivenquest for the Twenty TopS<strong>of</strong>tware People in the World than– by popular acclaim, as they say– we’re extending the field <strong>of</strong> candidates...from 40 to over <strong>10</strong>0. The question remains: Ifthese are the Top <strong>10</strong>0 S<strong>of</strong>tware People in theWorld, who are the Top Twenty?Here are the new additions to the list. (Toview the complete list go to http://<strong>sys</strong>-<strong>con</strong>.com/java.) A whole new round <strong>of</strong> votingbegins this month online and will stay open’till January 20. Have at it!• Gene Amdahl: Implementer in the ’60s<strong>of</strong> a milestone in computer technology:the <strong>con</strong>cept <strong>of</strong> compatibility between<strong>sys</strong>tems• Marc Andreessen: Pioneer <strong>of</strong> Mosaic,the first browser to navigate the WWW;co-founder <strong>of</strong> Netscape• John Vincent Atanas<strong>of</strong>f: Inventor <strong>of</strong> anelectronic computer in the late 1930s,not for fun or glory but because he hadproblems for it to solve• Charles Babbage: Lucasian Pr<strong>of</strong>essor<strong>of</strong> Mathematics at Cambridge in 1828;inventor <strong>of</strong> the “calculating machine”• John Backus: Inventor (with IBM) <strong>of</strong>FORTRAN (FORmula TRANslator), in1956• Ralph Baer: “The man who inventedvideo games” (Pong)• Kent Beck: Creator <strong>of</strong> JUnit and pioneer<strong>of</strong> eXtreme Programming (XP)• Bob Bemer: One <strong>of</strong> the developers <strong>of</strong>COBOL and the ASCII naming standardfor IBM (1960s)• D J Bernstein: Author <strong>of</strong> qmail• Fred Brooks: Co-creator <strong>of</strong> OS/390,helping to change the way we thinkabout s<strong>of</strong>tware development• Luca Cardelli: Implementer <strong>of</strong> the firstcompiler for ML (the most populartyped functional language) and one <strong>of</strong>the earliest direct-manipulation userinterfaceeditors• Vincent Cerf: “The Father <strong>of</strong> theInternet,” co-inventor <strong>of</strong> the firstInternetworking Protocol, TCP• Brad Cox: Father <strong>of</strong> Objective-C• Alonzo Church: Co-creator <strong>of</strong> the“Church-Turing Thesis”• Alistair Cockburn: Helped craft theJeremy GeelanAgile Development Manifesto• Edgar (Ted) Codd: “Father <strong>of</strong> RelationalDatabases,” inventor <strong>of</strong> SQL, and creator<strong>of</strong> RDBMS <strong>sys</strong>tems• Larry Constantine: Inventor <strong>of</strong> dataflow diagrams; presented first paperon <strong>con</strong>cepts <strong>of</strong> structured design in1968• Ole-Johan Dahl: Developer (withKristen Nygaard) <strong>of</strong> SIMULA, the firstobject-oriented programming language• Tom DeMarco: A principal <strong>of</strong> thecomputer <strong>sys</strong>tems think tank, AtlanticSystems Guild• Theo de Raadt: Founder <strong>of</strong> theOpenBSD and OpenSSH projects• Edsger W. Dijkstra: One <strong>of</strong> the movingforces behind the acceptance <strong>of</strong>computer programming as a scientificdiscipline; developer <strong>of</strong> the firstcompilers• Brendan Eich: Inventor <strong>of</strong> JavaScript;chief architect <strong>of</strong> the Mozilla Project• Robert Elz: University <strong>of</strong> Melbourne,Department <strong>of</strong> Computer Science• Doug Englebart: Father <strong>of</strong> the Mouse;devised the Open HyperdocumentSystem; interactive computing’s foundingpioneer• Richard P. Feynman: Legendary physicistand teacher, teacher <strong>of</strong> Caltechcourse (1983–86) called “Potentialitiesand Limitations <strong>of</strong> ComputingMachines”• Bill Gates: Chief s<strong>of</strong>tware architect (andlord high chief <strong>of</strong> everything else) <strong>of</strong>“the world’s #1 company” (Hoovers.com)• Adele Goldberg: Developer <strong>of</strong> SmallTalk,along with Alan Kay; wrote much <strong>of</strong> thedocumentation• Andy Hertzfield: Eazel developer andMacintosh forefather• Grace Murray Hopper: Developer <strong>of</strong> thefirst compiled high-level programminglanguage, COBOL• Jordan Hubbard: One <strong>of</strong> the creators<strong>of</strong> FreeBSD; currently a manager <strong>of</strong>Apple’s Darwin project• Jean D. Ichbiah: Principal designer, Adalanguage (1977)–<strong>con</strong>tinued on page 35Jeremy Geelan isgroup publisher <strong>of</strong><strong>SYS</strong>-<strong>CON</strong> <strong>Media</strong> andis responsible for thedevelopment <strong>of</strong> newtitles and technologyportals for thefirm. He regularlyrepresents <strong>SYS</strong>-<strong>CON</strong> at<strong>con</strong>ferences and tradeshows, speaking to technologyaudiences bothin North Americaand overseas.jeremy@<strong>sys</strong>-<strong>con</strong>.comwww.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 20053


JANUARY 2005 VOLUME:<strong>10</strong> ISSUE:1<strong>con</strong>tents<strong>JDJ</strong> Cover StoryJava TechnologyfortheWirelessIndustryby David Parsons, Ilan Kirsh, and Mark CranshawToys or tools?3022FeaturesSOA Solutions with J2EEby Bruno ColletFROM THE GROUP PUBLISHERi-Technology’s All-Time Top <strong>10</strong>0?by Jeremy Geelan.................................3EJBsJavaCaller: The Last Session BeanA powerful and universal EJBby Michael Havey.................................14DESKTOP JAVA VIEWPOINTThe Return <strong>of</strong> the Pigby Joe Winchester.................................42VIEWPOINTJ2ME: Has Its TimeFinally Arrived?by Eric Giguère.................................6PORTLETSPortal StandardsThe answer to portal interoperability?by Sue Vickers.................................18JAVA TIPSA Time Zone PatchA flexible solutionby Paulo Caroli.................................44JAVA ENTERPRISE VIEWPOINTFrom Smart Phones to EJB 3by Michael Juntao Yuan.................................8BLUETOOTHDeveloping Wireless BluetoothApplications in J2MEPortable, secure, and highly usableby Peter Mikhalenko.................................26LABSJBuilder 2005by Borland S<strong>of</strong>tware CorporationReviewed by Ken Sipe.................................48Translation-Based Integrationby Alexander Krapf38ARCHITECTURESWriting Classpath-lessJ2EE Clients......using a simple techniqueby Bahar Limaye.................................<strong>10</strong>CORE AND INTERNALS VIEWPOINTJava Insideby Calvin Austin.................................36@ THE BACKPAGELazy Programmers Can MakeCache Todayby Warren MacEvoy.................................62<strong>JDJ</strong> (ISSN#<strong>10</strong>87-6944) is published monthly (12 times a year) for $69.99 by<strong>SYS</strong>-<strong>CON</strong> Publications, Inc., 135 Chestnut Ridge Road, Montvale, NJ 07645.Periodicals postage rates are paid at Montvale, NJ 07645 and additionalmailing <strong>of</strong>fices. Postmaster: Send address changes to: <strong>JDJ</strong>, <strong>SYS</strong>-<strong>CON</strong>Publications, Inc., 135 Chestnut Ridge Road, Montvale, NJ 07645.www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 20055


Eric GiguèreViewpointJ2ME: Has Its TimeFinally Arrived?President and CEO:Fuat Kircaali fuat@<strong>sys</strong>-<strong>con</strong>.comVice President, Business Development:Grisha Davida grisha@<strong>sys</strong>-<strong>con</strong>.comGroup Publisher:Jeremy Geelan jeremy@<strong>sys</strong>-<strong>con</strong>.comEric Giguère is as<strong>of</strong>tware developerwith iAnywhereSolutions, where heworks on mobiletechnologies. Eric isthe author <strong>of</strong> thefirst-ever book onJava 2 Micro Editionprogramming aswell as numerousarticles on wirelessand handheldprogramming,including most <strong>of</strong>the J2ME Tech Tipspublished by SunMicro<strong>sys</strong>tems. Formore informationabout Eric and J2ME,visit his Web site atwww.ericgiguere.com.ericgiguere@ericgiguere.comHaving written about Java 2 MicroEdition (J2ME) programmingfor almost five years now, I’vebeen frustrated by the slowadoption <strong>of</strong> the J2ME platform, as havemany <strong>of</strong> the early devotees. Those <strong>of</strong> uswho saw Sun demonstrate Java runningon Palm OS back in 1999 were hopingthat the wireless Java revolution wasjust around the corner. The introduction<strong>of</strong> J2ME generated a lot <strong>of</strong> hypeand excitement (and <strong>con</strong>fusion) in theJava development community. Publishersrushed books to market, virtualmachines were announced, and devicemanufacturers started incorporatingJava technology into their plans. Butthe corner we wanted to turn was infact a long way <strong>of</strong>f. I think we’re finallyapproaching it, though.Writing a J2ME application isn’t reallythat hard. J2ME is, after all, just Java,albeit with a few restrictions. The developmentprocess is the same except fora couple <strong>of</strong> additional steps. If you’rean experienced Java developer, you canwrite J2ME applications. The plethora<strong>of</strong> acronyms will probably <strong>con</strong>fuse youat first, but there’s nothing radical tolearn – just new application programminginterfaces (APIs). If there’s onething J2ME is good at, it’s defining newAPIs!No, the hardest part <strong>of</strong> J2ME developmentis getting your application towork within the <strong>con</strong>straints imposedby real devices. Note that here we’remostly talking about mobile phones– the primary target for J2ME applicationstoday, even though J2ME is aboutmore than mobile phones. Unlikesimulators, devices have memory andprocessor speed limitations that cancripple you in unexpected ways. Youmay be a good Java coder, but howmuch <strong>of</strong> an application can you craminto 64K (or less) <strong>of</strong> memory? What’sworse, all the useful classes you’d expectto find in a modern J2SE implementationare mostly missing. As youcan imagine, code size reduction toolsand techniques are always hot topics <strong>of</strong>discussion among J2ME developers.Another problem with J2ME developmentis that buggy Java environmentshave been deployed to various devices.Developers are <strong>con</strong>stantly trippingover bugs with the Java virtual machineand the Java application managementsub<strong>sys</strong>tem. The manufacturers releasefirmware updates with bug fixes, buthow realistic is it to expect the average<strong>con</strong>sumer to know enough to upgradetheir phone? Instead they’ll try to runan application, see the applicationcrash or hang, and give up. It’s a no-winsituation for the developer.We may be turning the corner.It’s been long enough now for J2MEstandards to mature enough to includesome important features and capabilitiesthat were previously missing.Manufacturers are working on releasinghigher-quality implementations <strong>of</strong>those standards. Minimum standardsfor what a mobile phone should includein terms <strong>of</strong> J2ME capabilities havealso been defined in another standardknown as Java Technology for theWireless Industry (JTWI). These are allsimplifying life for J2ME developers.Just as important, a critical mass <strong>of</strong>devices is now out in the field. Again,we’re talking mobile phones here– PDAs running Palm OS or Pocket PCjust aren’t a viable market for J2MEdevelopment as <strong>of</strong> yet, because theyhave alternative programming toolsand languages and generally more openplatforms. The only exception to thiswould be the BlackBerry wireless handheld,which is actually a J2ME-baseddevice.With most <strong>of</strong> the new handsets beingproduced supporting either JTWI orelse its key component – version 2 <strong>of</strong>the Mobile Information Device Pr<strong>of</strong>ile(MIDP) – developers have a more<strong>con</strong>sistent and capable platform to usefor application development. There arestill problems that need to be addressedwith application testing and deployment,but I think J2ME’s time to shine isalmost here. Finally!AdvertisingSenior Vice President, Sales and Marketing:Carmen Gonzalez carmen@<strong>sys</strong>-<strong>con</strong>.comVice President, Sales and Marketing:Miles Silverman miles@<strong>sys</strong>-<strong>con</strong>.comAdvertising Sales Director:Robyn Forma robyn@<strong>sys</strong>-<strong>con</strong>.comNational Sales and Marketing Manager:Dennis Leavey dennis@<strong>sys</strong>-<strong>con</strong>.comAdvertising Sales Manager:Megan Mussa megan@<strong>sys</strong>-<strong>con</strong>.comAssociate Sales Managers:Kristin Kuhnle kristin@<strong>sys</strong>-<strong>con</strong>.comDorothy Gil dorothy@<strong>sys</strong>-<strong>con</strong>.comKim Hughes kim@<strong>sys</strong>-<strong>con</strong>.comEditorialExecutive Editor:Nancy Valentine nancy@<strong>sys</strong>-<strong>con</strong>.comAssociate Editors:Jamie Matusow jamie@<strong>sys</strong>-<strong>con</strong>.comGail Schultz gail@<strong>sys</strong>-<strong>con</strong>.comAssistant Editors:Natalie Charters natalie@<strong>sys</strong>-<strong>con</strong>.comSeta Papazian seta@<strong>sys</strong>-<strong>con</strong>.comOnline Editor:Martin Wezdecki martin@<strong>sys</strong>-<strong>con</strong>.comProductionProduction Consultant:Jim Morgan jim@<strong>sys</strong>-<strong>con</strong>.comLead Designer:Tami Beatty-Lima tami@<strong>sys</strong>-<strong>con</strong>.comArt Director:Alex Botero alex@<strong>sys</strong>-<strong>con</strong>.comAssociate Art Directors:Abraham Addo abraham@<strong>sys</strong>-<strong>con</strong>.comLouis F. Cuffari louis@<strong>sys</strong>-<strong>con</strong>.comRichard Silverberg richards@<strong>sys</strong>-<strong>con</strong>.comAssistant Art Director:Andrea Boden andrea@<strong>sys</strong>-<strong>con</strong>.comWeb ServicesInformation Systems Consultant:Robert Diamond robert@<strong>sys</strong>-<strong>con</strong>.comWeb Designers:Stephen Kilmurray stephen@<strong>sys</strong>-<strong>con</strong>.comMatthew Pollotta matthew@<strong>sys</strong>-<strong>con</strong>.comAccountingFinancial Analyst:Joan LaRose joan@<strong>sys</strong>-<strong>con</strong>.comAccounts Payable:Betty White betty@<strong>sys</strong>-<strong>con</strong>.comAccounts Receivable:Steve Michelin smichelin@<strong>sys</strong>-<strong>con</strong>.com<strong>SYS</strong>-<strong>CON</strong> EventsPresident, <strong>SYS</strong>-<strong>CON</strong> Events:Grisha Davida grisha@<strong>sys</strong>-<strong>con</strong>.comNational Sales Manager:Jim Hanchrow jimh@<strong>sys</strong>-<strong>con</strong>.comCustomer RelationsCirculation Service Coordinators:Edna Earle Russell edna@<strong>sys</strong>-<strong>con</strong>.comLinda Lipton linda@<strong>sys</strong>-<strong>con</strong>.comMonique Floyd monique@<strong>sys</strong>-<strong>con</strong>.com<strong>JDJ</strong> Store Manager:Brunilda Staropoli bruni@<strong>sys</strong>-<strong>con</strong>.com6 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


Michael Juntao YuanContributing EditorJava Enterprise ViewpointFrom Smart Phonesto EJB 3Dr. Michael Juntao Yuan is amember <strong>of</strong> <strong>JDJ</strong>’s editorial board.He is an expert in end-to-endmobile s<strong>of</strong>tware solutions. Hehas published more than 30articles in leading technicaland academic journalsin the past three years andprovided <strong>con</strong>sulting servicesto some <strong>of</strong> the biggestinformation technology firmsaround the world. Michaelis the author <strong>of</strong> two books:Enterprise J2ME (PrenticeHall, 2003) and DevelopingScalable Nokia Series 40Applications (Addison-Wesley,2004). He received aPhD from the University<strong>of</strong> Texas at Austin.michael.yuan@<strong>sys</strong>-<strong>con</strong>.comIn the past six months, I had the opportunityto work with two leadingfirms in the Java world – Nokia andJBoss. Being the world’s largest J2MEdevice vendor and most popular J2EEserver developer, respectively, Nokiaand JBoss come from the two ends <strong>of</strong>the Java technology spectrum, whichtraditionally have little to do with eachother. Yet, I have learned that theirvisions about the future <strong>of</strong> the Java technologyare strikingly similar. The core<strong>of</strong> this vision is to leverage “lightweightmiddleware” to deliver s<strong>of</strong>tware services.Indeed, from Nokia Communicatorphones to Eclipse-rich client applicationson the desktop to EJB 3.0 applicationservers, lightweight middlewaremight be the biggest story across all Javadomains in year 2005. As developers,you definitely need to know about it.The focus on middleware in a J2MEeditorial might come as a surprise tomany readers. Shouldn’t the hotspots inJ2ME be mobile 3D games, BluetoothP2P applications, and Internet-basedmobile business forms applications?Well, yes, those are important areas<strong>of</strong> J2ME applications. However, as aplatform, J2ME succeeds on the servicedelivery model it enables. A large part <strong>of</strong>the wireless industry is built uponservice delivery. For instance, theoperator-<strong>con</strong>trolled mobile <strong>con</strong>tentdelivery process enables themobile phone ringtone downloadbusiness to grow many timeslarger than the entire PC musicbusiness.The importance <strong>of</strong> servicedelivery is clearly illustrated bythe different fortunes <strong>of</strong> two J2MEproducts in the market place.MIDP (Mobile Information Device“Pr<strong>of</strong>ile) is phenomenally successful onmobile phones despite its numerouslimitations; but the Personal Pr<strong>of</strong>ile, afully featured Java 2 environment fordevices, is a market failure on PDA andhandheld computers. Many peopleblamed Sun for failing to release a PersonalPr<strong>of</strong>ile reference implementationon Pocket PC or Palm devices.The real question here is: Why didn’tPDA vendors rush to support J2ME PersonalPr<strong>of</strong>ile as mobile phone vendorsdid for MIDP? MIDP’s secret for successis that it enables developers and wirelessoperators to easily deliver valuables<strong>of</strong>tware services to the device users. TheMIDP runtime environment managesthe application life cycle, updates, andinteraction with the outside world (e.g.,the SMS message–triggered push registry).In other words, the MIDP follows a“middleware” model to deploy businesscomponents (a.k.a. the MIDlets) inmanaged <strong>con</strong>tainers. The J2ME PersonalPr<strong>of</strong>ile environment does not providesuch features and that is what has tochange to revive J2ME on high-endmobile devices.The proposed next generation architecture<strong>of</strong> J2ME (JSRs 232 and 249,led by Nokia, Motorola, and Vodafone)envisions advanced middleware serviceson high-end mobile devices.It focuses on remote provisioning<strong>of</strong> services, including applications,library APIs, and even <strong>sys</strong>tem s<strong>of</strong>twareupdates, using the OSGi (Open ServiceGateway initiative) micro-<strong>con</strong>tainer ondevices. This “client-side middleware”<strong>con</strong>cept already has a proven trackrecord. For instance, IBM PervasiveComputing has been selling OSGipoweredPDAs to enterprise customersfor several years. In the desktop world,the popular Eclipse IDE frameworkuses an embedded OSGi micro<strong>con</strong>tainerto run all plug-ins and richclient applications.On the J2EE server side, while thevalue <strong>of</strong> middleware and servicedelivery have been well accepted, theexisting middleware application models(e.g., EJB 2.1) are too complex formost developers and too heavyweightfor most applications. Lightweightmiddleware is a key design <strong>con</strong>ceptbehind the next generation EJB applicationservers (i.e., EJB 3.0). You candownload and play with JBoss’s EJB 3.0preview s<strong>of</strong>tware today to see what it’slike. Besides EJB 3.0, it would be easy toimplement OSGi services on top <strong>of</strong> theJBoss lightweight microkernel.In theory, we would then be ableto deploy the same services toJ2EE servers, Eclipse desktops,and J2ME devices. After years<strong>of</strong> separate development andfragmentation, J2ME and J2EEmight eventually <strong>con</strong>verge andunite under the vision <strong>of</strong> “lightweightmiddleware.”This is great news for allJava developers. Are you readyfor it?Why didn’t PDA vendors rush to support J2ME Personal Pr<strong>of</strong>ileas mobile phone vendors did for MIDP?”8 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


ArchitecturesWriting Classpath-lessJ2EE Clients...by Bahar Limaye. . . using a simple techniqueBahar Limaye is a<strong>sys</strong>tem architect atThe College Board.He has extensiveexperience buildingdistributed objectoriented<strong>sys</strong>tems.blimaye@collegeboard.orgDeveloping lightweight J2EEclient applications that interoperatewith multiple applicationservers can be difficult to do.Having to include an application server–specific JAR file along with a thin clientapplication can significantly increasethe size <strong>of</strong> the deployed application andmake it too big to be practical.In addition, client-side execution istightly coupled using proprietary appserverextensions. This is especially truewhen mixing and matching multipleJ2EE vendors together (such as a Tomcatservlet <strong>con</strong>tainer communicating with aWebLogic EJB tier). Standard protocols,such as RMI/IIOP, are supposed to alleviatethis problem. However, there is stillno standard API or library that can beused across application servers withoutsacrificing native features, such as:• Clustering and high availability(including load balancing andfailover)• Native communication protocols foroptimal performance, such as socketmultiplexing and efficient serialization(as opposed to standard RMI/IIOP)• Transaction management (includingdistributed transactions)• Security (JAAS, SSL transports)• Interoperability with previous andfuture versions <strong>of</strong> the applicationserver• Lack <strong>of</strong> support for other J2EE featuressuch as JDBC, and JMX• Specific JDK version requirementsThis article presents a simpletechnique using URL classloading andreflection to build portable, ultra-thinJava client applications without addinganything in the classpath, while preservingall <strong>of</strong> the application servers’ nativefeatures. (The source code for thisarticle can be downloaded from www.<strong>sys</strong>-<strong>con</strong>.com/java/sourcec.cfm.) Specifically,this article demonstrates how to:• Use the java.net.URLClassLoader toobtain Java resources from an HTTP<strong>con</strong>nection to achieve dynamic classloading and automatic s<strong>of</strong>tware distributionwhile maintaining a zeroclient footprint.• Invoke methods reflectively with theURLClassLoader and understandthat the code is dynamically boundat runtime versus compile time.• Create high-bandwidth and smallmemoryfootprint JVM applicationsdeployed as thick-client applicationsand utilize this technique to obtainJ2EE, XML, rich client libraries, andbusiness rules from the server.Listing 1 is an example <strong>of</strong> an ultra-thinJ2EE client application invoking an HelloWorldEJB. It obtains an InitialContextfrom JNDI, looks up a home interface,creates the remote object, and invokes amethod. Notice that there are no Java importsto J2EE APIs or dependent classes(HelloWorld objects) for compilation andexecution. A URLClassLoader is utilizedto retrieve the necessary class files viaHTTP on demand. All <strong>of</strong> the applicationservers’ functionality, such as the internalcommunication mechanism, security,transaction management, etc., areautomatically downloaded and executed.This also applies to the user-definedapplication code, such as the HelloWorldclient stubs and home interfaces.High-Level OverviewOne <strong>of</strong> the greatest features <strong>of</strong> the Javaplatform is the ability to dynamicallydownload and execute Java code froma set <strong>of</strong> URLs to a Java Virtual Machine(JVM). The result is that a remote <strong>sys</strong>temcan run a program, for example, athin J2EE client, which has never beeninstalled on its disk. Using the java.net.URLClassLoader and reflection APIs, anyJVM can download any Java resource,including RMI stubs, which enablesthe execution <strong>of</strong> method calls on aremote server using the server <strong>sys</strong>tem’sresources.How It WorksThe ThinClient.java program doesnot <strong>con</strong>tain any imports other than thecore J2SE APIs. It uses a URLClassLoaderto load its Java resources (see Figure 1).The URL is a servlet (see Listing 2) that’sdeployed on an application server aspart <strong>of</strong> an .ear file.1. The application server binds theHelloWorld EJB into JNDI. TheClassLoader servlet and Web application(see Listing 2) is deployed on theserver and includes the HelloWorld_ejb.jar as part <strong>of</strong> the classpath. Whenresources are accessed from this servlet,it will serve classes from its .war,EJB classes, .ear, and System classpath.(Listings 2–5 can be downloadedfrom www.<strong>sys</strong>-<strong>con</strong>.com/java/sourcec.cfm.)2. The thin J2EE client application usesthe URL ClassLoader to load Javaresources. The particular example inListing 1 loads all classes using thisclassloader.// set the <strong>con</strong>text class loader to a URLClassLoaderClassLoader classLoader;Thread.currentThread().setContextClass-Loader(classLoader = new URLClassLoader(new URL[] {newURL("http://localhost:7001/classloader/ClassLoaderServlet/")}));3. The thin J2EE client application usesreflection to instantiate a hashtableto set up the InitialContext and<strong>10</strong> January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


performs a JNDI lookup operationreflectively. The URLClassLoaderis used to download the applicationserver’s required classes for thelookup operation. The HelloWorldstubs are returned and executed onthe thin client (see Listing 3).4. The thin J2EE client performs methodcalls via reflection to the server(see Listing 4).Listing 2 <strong>con</strong>tains the servlet codethat loads the Java resources. In this particularexample, the servlet is colocatedwith the application in the same J2EE<strong>con</strong>tainer.Java resources are accessed using thefollowing syntax:http://:/classloader/ClassLoaderServlet/test/Example.classThe extra path information:/test/Example.classis a hypothetical class called test.Examplein the <strong>sys</strong>tem classpath or part <strong>of</strong>the .war or .ear files.Alternative TechnologiesA client can access an applicationservice several ways. For example, aclient may use a proprietary protocol,RMI/IIOP, JMS, or Web services. Severaladvantages and disadvantages existwith each <strong>of</strong> these communicationtechnologies, and choosing the most“optimal” client application design canbe challenging.Interoperability is one factor thatcomes to mind when choosing a communicationmechanism. Both thin J2EEclients and Web services fit well in thismodel. Web services give clients theability to interoperate with almost anytype <strong>of</strong> <strong>sys</strong>tem and application, regardless<strong>of</strong> the platform on which the <strong>sys</strong>temor application runs. The thin J2EE clientapproach is limited to Java, but allows<strong>con</strong>versational state, asynchrony, transactions,security, and high-availabilityperformance.Web services use HTTP as the transportprotocol, enabling clients to operatewith <strong>sys</strong>tems through firewalls. Theservice’s WSDL document enables clientsand services that use very differenttechnologies to map and <strong>con</strong>vert theirrespective data objects. For services andclients that are based on JAX-RPC, theJAX-RPC runtime handles this mappingtransparently.Listing 5 illustrates how to createa dynamic Web service using WSDL.Notice that there are only J2EE imports.It’s very similar to the ThinClient.javaexample, in that the operation andservice definitions are dynamicallyobtained.The thin J2EE client approach is fasterthan Web services, since it uses nativecommunication protocols while makingremote calls over the network. However,it’s better suited for clients operating inintranet environments where there is agreater degree <strong>of</strong> <strong>con</strong>trol over the client’sdeployment and the J2EE server. Adownside for this environment is passingthrough firewalls. Furthermore, thisapproach provides clients with secureaccess to the application business logicwhile at the same time taking care <strong>of</strong> thedetails <strong>of</strong> the client and server communicationand marshalling and unmarshallingparameters.Java Message Service (JMS) is anothermeans for thin J2EE clientsto communicate with server applications.It provides a means for asynchronouscommunication. Applicationsusing JMS are better suited to a settingthat is behind a firewall, since messaging<strong>sys</strong>tems generally don’t workwell on the Internet (<strong>of</strong>ten, messaging<strong>sys</strong>tems are not even exposed on theInternet).Using Thin Clients with theWebLogic ServerCheck your J2EE application serverdocumentation to see if it comes witha resource to serve objects to the client.For example, the WebLogic server<strong>con</strong>tains a built-in servlet, called ClasspathServlet,to serve Java resources in adistributed manner. The servlet code inListing 2 is not required, since this featurecomes out-<strong>of</strong>-the-box in WebLogic.The URL syntax is as follows:http://:/bea_wls_internal/classesFigure 1 ThinClient.java programThe bea_wls_internal is a default Webapplication that is enabled by default.The /classes part <strong>of</strong> the URL is registeredto the internal weblogic.servlet.ClasspathServlet.If the URL is set to /bea_wls_internal/classes, the classes required by the thinJ2EE client should be available in the<strong>sys</strong>tem classpath <strong>of</strong> the server.If the URL is set to /bea_wls_internal/classes/DefaultWebApp@DefaultWeb-App, the classes required by the thinJ2EE client should be in the applications/DefaultWebApp/WEB-INF/classesdirectory or in the <strong>sys</strong>tem classpath.Versions prior to WebLogic 7 mustregister the ClasspathServlet and it’saccessed via the /classes URL.www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200511


ArchitecturesFor this to operate successfully, youmust add the following parameter to theWebLogic start script:-Dweblogic.servlet.ClasspathServlet.disableStrictCheck=trueThis relaxes the restriction <strong>of</strong> thedownloadable file type. Hence, anyJava resource can be served from thisservlet.Java Web StartJava Web Start (JSR 000056) is a builtinJ2SE s<strong>of</strong>tware-distribution mechanismthat downloads and executes Javas<strong>of</strong>tware from a HTTP server. Typically,it’s used from a browser and works wellwith the Java plug-in. The Java NetworkLanguage Protocol (JNLP) is the underlyingcommunication mechanismused by Java Web Start. Alternatively,Java Web Start can be invoked from thecommand line using the javaws utility.The techniques presented in thisarticle are not meant as a replacementfor Java Web Start. They simply demonstratehow to create lightweight clientsin your own programs when you needto selectively download and executeapplication code.SummaryAs service-oriented architectures reemerge,it becomes crucial to have a decoupledand extensible client layer thatcan accommodate change and dynamicbehavior. Constant API changes andbackward compatibility problems canoccur during <strong>con</strong>current developmentcycles. For an architecture that <strong>con</strong>sists<strong>of</strong> all Java components (both client andserver), Web services may not be the bestchoice, since it can cause performancedegradation (overhead <strong>of</strong> XML parsing),deployment problems (load balancing/failover), and security issues.Utilizing the native application serverfeatures, such as clustering, transactions,and security, with a looselycoupled implementation, architecturescan focus on integration versusenvironmental problems. Constant APIchanges and backward compatibilityproblems can occur during <strong>con</strong>currentdevelopment cycles. Building a very thinclient layer can facilitate dynamic codechanges and provide an adaptable andextensible architecture.Resources• Tutorial: Getting Started Using RMI-IIOP: http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/tutorial.html• Java Web Start FAQ: http://java.sun.com/products/javawebstart/faq.html#55http://e-docs.bea.com/wls/docs81/rmi_iiop/rmiiiop2.html#DevelopingThinClient• java.net: Class URLClassLoader:http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLClassLoader.htmlListing 1package examples;import java.net.*;import java.util.*;import java.lang.reflect.*;public class ThinClient {public static void main(String[] args) {try{// set the <strong>con</strong>text class loader to a URL ClassLoaderClassLoader classLoader;Thread.currentThread().setContextClassLoader(classLoader = new URLClassLoader(new URL[] {newURL("http://localhost:7001/classloader/ClassLoaderServlet/")}));// setup the InitialContext informationHashtable env = new Hashtable();env.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");env.put("java.naming.provider.url", "t3://localhost:7001");// equivalent <strong>of</strong> ctx = new InitialContext();Class ctxClass = classLoader.loadClass("javax.naming.InitialContext");Constructor ctxConstructor = ctxClass.getConstructor(new Class[]// equivalent <strong>of</strong> home = ctx.lookup("HelloWorldHome");Method method_lookup = ctx.getClass().getDeclaredMethod("lookup", newClass[] { Class.forName("java.lang.String") });Object home = method_lookup.invoke(ctx, new Object[]{ "HelloWorldHome"});System.out.println("Home is: " + home);// equivalent <strong>of</strong> remote = home.create();Method method_create = home.getClass().getDeclaredMethod("create",null);Object remote = method_create.invoke(home, null);// get sayHello and remove methodsMethod method_sayHello = remote.getClass().getDeclaredMethod("sayHello",new Class[] { Class.forName("java.lang.String")});Method(Method method_remove = remote.getClass().getDeclared-"remove",null);// equivalent <strong>of</strong> calling remote.sayHello("Test");method_sayHello.invoke(remote, new Object[] { "Test"});// remove the remote objectSystem.out.println("Removing the Hello World Bean");method_remove.invoke(remote, null);{Class.forName("java.util.Hashtable")});Object ctx = ctxConstructor.newInstance(new Object[]{ env });System.out.println("Context is: " + ctx);}}} catch(Exception e) {e.printStackTrace();}12 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


EJBsJavaCaller:The Last Session Beanby Michael HaveyA powerful and universal EJBMichael Havey is a BEA<strong>con</strong>sultant with eight years <strong>of</strong>industry experience, mostlywith application integration.He is also a father, poet,philosopher, and sports fan.mhavey@bea.comMost Enterprise JavaBeans(EJBs) serve a definite purpose,performing a specificset <strong>of</strong> actions on behalf <strong>of</strong>client applications. The ubiquitousBank Account bean, which supportsbasic account transactions such aswithdrawal and deposit, appears inalmost every J2EE tutorial. Studentsare persuaded that real-life EJBs,though more advanced, are as practicaland particular as those developedin the classroom.This article presents an unusualstateful session bean called JavaCaller,whose interface is entirely general,providing client applications with theability to run arbitrary Java code onthe application server. Because <strong>of</strong> itsgenerality, JavaCaller can be made todo anything that any other sessionbean can do; to use the language <strong>of</strong>computability theory, any problemthat can be solved by a session beancan be solved by JavaCaller.What distinguishes JavaCallerfrom other session beans is that itsexecution <strong>of</strong> actions is completely<strong>con</strong>trolled by client applications.Different clients can make JavaCallerdo different things because the clientmanages the <strong>con</strong>trol flow. Supportinga simple reflection interface, JavaCallerexposes methods that let clientscreate objects and classes, invokeclass or object methods, and get orset object fields, all on the server side.As Figure 1 shows, JavaCaller is likea robotic arm, <strong>con</strong>trolled remotelyby client applications to manipulateclasses and objects in the applicationserver’s JVM.Not that the tutorials are wrong;the specificity <strong>of</strong> the typical EJB is avirtue. Lack <strong>of</strong> specificity implies lack<strong>of</strong> focus and gets flagged during designreview; an EJB should do exactlywhat it is required to do. However,JavaCaller’s purpose is atypical: itis a hook into the server JVM, or,alternatively, a shell that runs scriptsand jobs on the server. It opens upthe application server to users to thedegree that operating <strong>sys</strong>tem shellsopen up the operating <strong>sys</strong>tem. True,application servers provide management<strong>con</strong>soles and open managementAPIs such as SNMP and JMX,but only for the administration <strong>of</strong>managed objects, such as applicationsand resources. The shell is aninterface to all the nonmanagedobjects too.JavaCaller APIJavaCaller is a stateful session EJBthat can run on any J2EE applicationserver supporting EJB 2.0. (It has beentested on BEA WebLogic 7.0 and 8.1.)JavaCaller’s home interface is a create()method with no arguments. Itsremote interface, shown in Figure 2,provides client applications with theability to manipulate objectsand classes in the server’s addressspace.JavaCaller can get or set static fields(getClassField(), setClassField())and call static methods (callClass-Method()), as well as get and setobject-level fields (setField(), get-Field()) and call object-level methodsMethodLoadClassCreateClassInstantiateCallMethod, CallClassMethodGetField, GetClassFieldTable 1 JavaCaller cache management(callMethod()). JavaCaller can alsoinstantiate a class (instantiate()), adda new class to JavaCaller’s class loader(createClass()), and return to theclient a serialized copy <strong>of</strong> an object(getObject()).JavaCaller stores object and classreferences in its object cache. Thiscache, which <strong>con</strong>stitutes the clientstate <strong>of</strong> the bean, is empty when theclient’s session begins and builds upas the client uses objects and classes.JavaCaller is stateful because it managesan object cache for the client. Thepopulation <strong>of</strong> the cache is described inTable 1.In keeping with the notion <strong>of</strong>“remote <strong>con</strong>trol,” the client neveruses server objects directly, but hasJavaCaller use them on its behalf. Theclient normally resides in a separateaddress space anyway, making directmanipulation impossible. JavaCaller’sgetObject() method returns to theclient a serialized copy <strong>of</strong> a serverobject, which provides the client witha snapshot <strong>of</strong> the object’s state andperhaps the ability to play with itlocally. However, because the objectis only a copy, nothing the client doeswith it has any server-side effect. Ifthe client wants to perform successiveoperations on the same server-sideobject, it calls successive JavaCallermethods passing the same numericActionJavaCaller generates a class reference for the specified class name.JavaCaller creates a new class as defined by client-specified byte code,and then adds a reference to the new class to the cache.JavaCaller instantiates an object and adds the object reference to thecache.If the method returns an Object (rather than a primitive type),JavaCaller adds its reference to the cache.If the field is an Object (rather than a primitive type), JavaCaller adds itsreference to the cache.14 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


object reference, representing anindex to JavaCaller’s object cache.Note: Objects maintained by Java-Caller need not be serializable, butgetObject() works only for serializableobjects.Most JavaCaller methods returneither an integer or a Union. Theinteger is a cache reference identifierthat the client can use to specifyan object or class when invokingsubsequent JavaCaller methods. The<strong>con</strong>cept underlying the Union typecomes from the “C” union type: itrepresents a value <strong>of</strong> one type selectedfrom a set <strong>of</strong> possible types.In the <strong>con</strong>text <strong>of</strong> JavaCaller, thesetypes are:• Primitive types, such as int anddouble, which Union stores as Javawrapper types such as java.lang.Integer and java.lang.Double.• Cache object references.• Objects – a <strong>con</strong>venience for clientsthat can be used to passan object argument, rather thanan object reference, when instantiatingan object, calling a method<strong>of</strong> an object or class, or setting afield <strong>of</strong> an object or a class. Thisoption should be used only for serializableobjects, such as java.lang.String.A Union is returned from the get-Field(), getClassField(), callMethod(),and callClassMethod() JavaCallermethods. If the given field or methodreturn value is an object, JavaCallersets the object reference field in theUnion; otherwise, it sets the primitivefield in the Union.The Union type is also used as anargument type in JavaCaller methods.In setField() and setClassField(), theclient uses it to specify a new objector primitive value for the specifiedfield. In callMethod(), callClass-Method(), and instantiate(), the clientuses it to specify object or primitiveargument values for the given methodor <strong>con</strong>structor. In this case, the clientalso specifies the string name <strong>of</strong> theargument type (for example, “int” fora primitive integer type, “java.util.Date” for the Date object type). Thisis required because classes or objectscan overload methods and <strong>con</strong>structors.Argument types are required todistinguish methods or <strong>con</strong>structorswith the same name.Intended CodeExecuteThreadManager mgr = Kernel.getExecuteThreadManager();int numIdle = mgr.getIdleThreadCount();StringBuffer sb = new StringBuffer(“Num idle = “);sb.append(numIdle);String s = sb.toString();System.out.println(s);Table 2IdlerWatchdog code vs intended server codeThe createClass() method allowsthe client to add a new class on theserver side. The client passes abuffer <strong>of</strong> bytes, representing the <strong>con</strong>tents<strong>of</strong> a Java class file on the clientside. JavaCaller dynamically addsa new class on the server side basedon the specified byte code andadds a reference to the class in itsobject class. The client can thenmanipulate the new class, or createinstances <strong>of</strong> it and manipulate thoseinstances.ExamplesExample 1: WebLogic MonitoringThis simple example shows how aclient application uses WebLogic serverobjects to monitor the idle thread count<strong>of</strong> a WebLogic server. As shown in Listing1, this example gets the idle threadcount <strong>of</strong> the server using the weblogic.kernel package. It then prints out thisresult in the standard output <strong>of</strong> the server.(Listings 1 and 2 can be downloadedfrom www.<strong>sys</strong>-<strong>con</strong>.com/java/cfm.)The main steps are as follows:1. In the <strong>con</strong>structor (lines 18–36),get the initial <strong>con</strong>text and acquirea reference to the JavaCaller homeinterface.Code RequiredUnion uTM = caller.callClassMethod("weblogic.kernel.Kernel","getExecuteThreadManager", null);Union uNumIdle = caller.callMethod(uTM.getObjectRef(),"getIdleThreadCount", null);Union sbArgs[] = new Union[1];sbArgs[0] = new Union();sbArgs[0].setObject("Num idle = " );sbArgs[0].setArgType(String.class.getName());Int sbref=caller.instantiate(StringBuffer.class.getName(),sbArgs);Union apArgs[] = new Union[1];apArgs[0] = new Union();apArgs[0].setPrimitiveWrapper(uNumIdle.getPrimitiveWrapper());apArgs[0].setArgType("int");caller.callMethod(sbref, "append", apArgs);Union tos = caller.callMethod(sbref, "toString", null);Union uout=caller.getClassField(System.class.getName(), "out");Union printArgs[] = new Union[1];printArgs[0] = new Union();printArgs[0].setObjectRef(tos.getObjectRef());printArgs[0].setArgType(String.class.getName());Caller.callMethod(uout.getObjectRef(), "println", printArgs);Figure 1 JavaCaller, server JVM robotic arm with remote <strong>con</strong>trolFigure 2 JavaCaller class diagram2. Call the create() method <strong>of</strong> thehome interface (line 42) to createa new instance <strong>of</strong> JavaCaller called“caller.”3. In lines 43–95, use caller to affectobject interactions on the serverside. Table 2 maps server code toequivalent client-side code.4. Remove the caller, cleaning up thecache (line 99).www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200515


EJBsExample 2: The Last Web ServiceThe se<strong>con</strong>d example shows how towrite a Web service, called PourJava-OnServer, that loads and runs classeson the server. The Web service is writtenin WebLogic Workshop, a graphicalWeb service development tool fromBEA.PourJavaOnServer has one method,runObject(), that does the following:1. Loads a class into the server JVM,based on the fully qualified classname and byte code (passed to theWeb service in Base 64 encoding)specified by the user. The class isrequired to have a default <strong>con</strong>structorand a method called exec()whose signature is:String exec(String)2. Instantiates the class with itsdefault <strong>con</strong>structor.3. Calls the <strong>con</strong>structed object’s exec()method, passing an argument specifiedby the Web service user.4. Returns the exec() return string tothe Web service user.The runObject() method, whosesource code is provided in Listing 2,calls the JavaCaller EJB to do the hardwork, invoking createClass() to loadFigure 3 PourJavaOnServer in WebLogic Workshop Editorthe class into the server JVM (line 4),instantiate() to invoke its default <strong>con</strong>structor(line 6), callMethod() to invokethe exec() method (line 13), and getObject()(in line 15) to get a local copy<strong>of</strong> the String object that is returned bythe exec() method; that String becomesthe return value <strong>of</strong> the Web servicemethod.PourJavaOnServer is simply a Webservice façade for JavaCaller. It can dowhat any other Web service deployedon WebLogic Server can do, andanything else too. The user drives thebehavior <strong>of</strong> the Web service; the logicis in the user’s Java class. To run a jobon the server, the user first writes thesource code <strong>of</strong> the class (it must have adefault <strong>con</strong>structor and exec() methodas specified above), then compilesthe class. The user then calls the Webservice, which uploads the class to theserver and executes it. The universality<strong>of</strong> the JavaCaller EJB implies theuniversality <strong>of</strong> the PourJavaOnServerWeb service.Figure 3 shows PourJavaOnServeropen in WebLogic Workshop.SecurityContinuing with the analogy <strong>of</strong> Java-Caller and an operating <strong>sys</strong>tem shell,when a user logs into (or authenticateswith) an operating <strong>sys</strong>tem, the user’saccess (or authorization) is dictatedby permissions on files. Operating <strong>sys</strong>temsdefine super users who have fullaccess to files, and who therefore cando anything; most users have limitedcapabilities, however. To authenticatewith JavaCaller means to authenticatewith WebLogic and acquire a referenceto JavaCaller. However, once auser is into JavaCaller, it is impossibleto restrict access to most <strong>of</strong> the serverJava objects. J2EE security cannot lockdown arbitrary server objects the wayoperating <strong>sys</strong>tems can lock down files.A hacker could do a lot <strong>of</strong> damage.The following guidelines should be<strong>con</strong>sidered when <strong>con</strong>figuring an applicationserver running JavaCaller.1. Set up J2EE security on JavaCallerso that its use is restricted to J2EE<strong>sys</strong>tem administrators. That way, aclient application can have access byfirst authenticating as an administrativeuser.2. Restrict access to JavaCaller to userson the internal network.3. Run the application server hostingJavaCaller under an operating <strong>sys</strong>temaccount that has limited <strong>sys</strong>temprivileges, preferably just enough forthe server to function. JavaCaller canbe programmed, for example, to usethe “java.io” package to recursivelydelete all files in a file <strong>sys</strong>tem; but ifthe application server lacks permissionto delete most <strong>of</strong> these files, theJava calls made by JavaCaller fortunatelywill fail.SummaryThe generality and passivity <strong>of</strong>JavaCaller makes it extremely powerful.However JavaCaller is intendedmainly for power users (e.g., administrators,developers, hackers) who areexperienced in the terrain <strong>of</strong> Java andthe application server. JavaCaller is anexquisite “back door” that lets expertsquery or program the server withouthaving to add specialized server-sideinterfaces. In addition, the <strong>con</strong>trolflow <strong>of</strong> JavaCaller cannot be sharedamong clients; execution is determinedon a per-client, per-sessionbasis. A client cannot deploy its logicfor use by the rest <strong>of</strong> the world; that isnot the purpose. JavaCaller is not thelast session bean.16 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


A free <strong>of</strong>fer for readers <strong>of</strong> Java Developer’s Journal!Formula One e.Spreadsheet Engine:Finally, there’s a supported, Pure Javatool that merges the power <strong>of</strong> Excelspreadsheets and Java applications.1 Automatically generate dynamicExcel reports. No more manualquerying and cutting-and-pastingto create Excel reports!2 Manage calculations and businessrules on J2EE servers with Excelfiles. No more translating Excelformulas to Java code!3 Embed live, Excel-compatible datagrids in applets and Java desktopapplications. No more static HTMLor presentation-only data grids!Downloadthis quick-readwhite paperand trial today!Download your trial and test our demosand sample code. See for yourself howthe Formula One e.Spreadsheet Enginecan help your Java application leveragethe skills <strong>of</strong> Excel users in your business.http://www.reportingengines.com/download/21ways.jspFREE TRIALS,DEMOS, &SAMPLECODE!888-884-8665 • www.reportingengines.comsales@reportingengines.comBuild reports against JDBC, XML, Java objects, BEA Portal Server logs, BEALiquid Data, and other sources visually or with Java code. It’s embedded!No external report server to set up. Unlimited users and CPUs per license.http://www.reportingengines.com/download/f1ere.jspCopyright © 2004 ReportingEngines (a division <strong>of</strong> Actuate Corporation). All rights reserved. Formula One is a registered trademark <strong>of</strong> Actuate Corporation.Java and Java-based trademarks and logos are the trademarks or registered trademarks <strong>of</strong> Sun Micro<strong>sys</strong>tems Inc., in the United States and other countries. All other trademarks are property <strong>of</strong> their respective owners. All specifications subject to change without notice.


PortletsPortal StandardsThe answer to portal interoperability?by Sue VickersSue Vickers is a group managerfor Oracle Application ServerPortal and has been with Oraclesince 1998. Her team specializesin declarative and programmaticportlet development as wellas application integration. Sheworks closely with the Oracledevelopment team that activelyparticipates on the committeesfor JSR 168 and WSRP. A certifiedDBA, Sue has <strong>con</strong>siderableexperience at Oracle. She joinedthe Portal team from OracleSupport, where she was theWebDB team lead and anaward-winning analyst andgained a breadth <strong>of</strong> knowledgein Internet and mobileapplicationdevelopment.sue.vickers@oracle.comAs demonstrated by theemergence <strong>of</strong> multiple portalinitiatives within organizationstoday, the benefits <strong>of</strong> enterpriseportals are clearly understood. It’scommon to see several enterprise portalplatforms deployed throughout an organization.However, many companies areattempting to standardize on one portalframework but are challenged withintegrating disparate portal instances.Each portal instance requires developers,partners, <strong>sys</strong>tem integrators, andindependent s<strong>of</strong>tware vendors (ISVs) todevelop portlets using proprietary applicationprogram interfaces (APIs) thatsupport only a single portal platform(see Figure 1). Thus, portlets built forone portal platform will not interoperatewith another portal platform.Developers find themselves buildingthe same portlet many times to supportthe APIs <strong>of</strong> multiple portal vendors.More important, developers are not theonly ones affected by proprietary APIs.Portal page designers and administratorslooking to build an enterpriseportal are <strong>of</strong>ten faced with a limitednumber <strong>of</strong> available portlets from aparticular portal vendor. The solution tothese challenges lies in the form <strong>of</strong> twocomplementary portlet standards: WebServices for Remote Portlets (WSRP)and Java Specification Request (JSR)168, which enable the development<strong>of</strong> interoperable portlets. With thesestandards, portlets built for one portalplatform can be rendered on a differentportal platform as long as the vendorsupports one or both <strong>of</strong> the standards.The availability <strong>of</strong> these standardsdynamically changes the landscape <strong>of</strong>the portal market. When deploying enterpriseportals, organizations will havea wide array <strong>of</strong> standards-based portletsto choose from. Portlet providers won’tneed to invest resources and build APIsfor each vendor platform (see Figure 2).In short, building portal pages becomesas simple as selecting portlets from aportal repository or catalog.Overview <strong>of</strong> WSRP and JSR 168WSRP is a Web services standardthat allows the plug-and-play <strong>of</strong>visual, user-facing Web services withportals or other intermediary Webapplications. Because it’s a standard,WSRP enables interoperability betweena standards-enabled <strong>con</strong>tainerand any WSRP portal. JSR 168 is aspecification that defines a set <strong>of</strong> APIsto enable interoperability betweenportlets and portals, addressing theareas <strong>of</strong> aggregation, personalization,presentation, and security.Similar to other industry standards,WSRP and JSR 168 are closely related.What is the relationship betweenWSRP and JSR 168? WSRP is governedby the OASIS technical committeesand JSR 168 is governed by the JavaCommunity Process (JCP). These twostandards work in <strong>con</strong>junction to supportportlet and portal interoperability.WSRP is a universal communicationprotocol between portals (<strong>con</strong>sumers)and portlet <strong>con</strong>tainers (producers)<strong>of</strong> any type. JSR 168 is a Java API thatstandardizes Java portlets and allowsdevelopers to build interoperableportlets. It’s important to note thatone standard does not require theother. A portal can support JSR 168and not support WSRP. A WSRP-enabledportal can <strong>con</strong>sume portlets <strong>of</strong>any type including Java and .NET. Theproducer simply needs to provide a set<strong>of</strong> Web services interfaces that includeself-description, markup, registration,and portlet management. DevelopersPortalVendor APortalVendor BPortalVendor CPartner APartner APartner AWeather PortletNews PortletWeather PortletNews PortletWeather PortletNews PortletFigure 1 Partner A re-creates the Weather and Newsportlet for each portal vendor they support.who build producers based on .NETcan register their portlet on the sameportal as a developer who has registereda Java producer, as long as thatportal supports WSRP.For example, two developers,developer A and developer B, havebuilt portlets based on at least one<strong>of</strong> the standards. In addition, thereare two portals: portal1 uses WSRPto communicate to portlets remotely(supports WSRP and JSR 168) and portal2supports only local portlets andcannot communicate with portletsremotely (supports JSR 168, but notWSRP).Developer A creates a portlet basedon JSR 168 and hosts this portlet onan application server. The developerwants to render this portlet on twoportals. Developer A provides a WSDLURL to portal1 to register the portletand add it to a page. Portal1 doesn’tcare that this portlet is Java since theportlet is remote and communicationis done through WSRP. Therefore,its implementation language doesn’tmatter. Developer A then deploysthe portlet into portal2 locally andmaps directly to the portlet, renderingthe <strong>con</strong>tent by making direct callsto it. This developer was able to createthe portlet once and make it availableto two different portals, althoughone supported WSRP and JSR 168,while the other supported onlyJSR 168.On the other hand, developer Bcreates a portlet based on .NET, buthas deployed it to a <strong>con</strong>tainer that isWSRP enabled. The developer is ableto render this portlet on portal1 sincethe <strong>con</strong>tainer is WSRP enabled and theportal does not care that the portlet isimplemented in .NET. The developercannot render the portlet on portal2because this portal does not supportWSRP or .NET.WSRP provides:• A WSDL interface description for theinvocation <strong>of</strong> WSRP services18 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


• Markup fragment rules for markupemitted by the WSRP services• The method to publish, find, andbind WSRP services and metadata• Interactive, user-facing Web servicesto be easily plugged into standardscompliantportals• Parameters that developers and pagedesigners use to create and publishtheir <strong>con</strong>tent and applications asuser-facing Web services• Ways in which page designers andportal administrators find Web servicesthrough a catalog, repository, orUDDI and publish them directly intotheir portal without any programming• Portlets to make <strong>con</strong>tent available for<strong>con</strong>sumption by other portals as Webservices• Standards that allow portlets <strong>of</strong> differentlanguages to be renderedequivalently on any portal server thatsupports WSRP• Support for remote portlets or theability to store the application in onecentral location and render at multipleportal serversJSR 168 provides:• The portlet API (portlet <strong>con</strong>tainer)that provides a runtime environmentto invoke portlets. Developers usethis API to program portlets that renderon compliant portals.• A URL-rewriting mechanism for creatinguser interaction within a portlet<strong>con</strong>tainer.• Security and personalization <strong>of</strong>portlets.• A common API for interoperabilityand portability <strong>of</strong> Java portletsbetween portal vendors.Portal Standards Free Up End UsersWith the approval <strong>of</strong> WSRP in September2003 and JSR 168 in October2003, an overwhelming power waspassed to end users. They now have thefreedom to build portal applicationswithout being tied to a portal vendor’splatform. These standards force portalvendors to focus more on applicationlevelfeatures and functionality. Portalvendors must now compete on the basis<strong>of</strong> their total <strong>of</strong>fering, including highavailability, performance, and integrationwith other components that <strong>of</strong>fersuch features as caching, security, andwireless support.Comparison Between Proprietary APIsand Standard APIsThe portal standards provide a fullset <strong>of</strong> features and functionality, butmay not <strong>of</strong>fer all <strong>of</strong> the capabilitiesthat are available from other vendors’proprietary APIs. The strength thatthese standard APIs have over proprietaryAPIs is compatibility. In addition,portal standards also <strong>of</strong>fer the followingcapabilities:• Edit defaults• Customization• Expiry-based caching• Private parameters and events• URL rewriting• Single sign on (SSO) integration• Resources “proxying”• InternationalizationWhat should <strong>con</strong>sumers <strong>con</strong>siderwhen deciding which APIs to beginbuilding upon today? Here are some<strong>con</strong>siderations:• Investigate functionality availableversus “must-have” requirements.Can I live with the functionality thestandards currently have?• Is supporting multiple portal platformsreally a requirement? Thisrequirement is especially importantfor portal partners, ISVs, and <strong>sys</strong>temintegrators, but not always importantto other portal <strong>con</strong>sumers. Ifnot a heterogeneous environment,how <strong>of</strong>ten should you change portalplatforms?• Remember that vendor APIs are<strong>of</strong>ten backward compatible. Usingyour vendor’s APIs today doesn’t preventyou from upgrading tomorrow.The standard committees are alreadylooking at the next release <strong>of</strong> thesestandards: WSRP v2.0 is planned forearly to mid 2005.Building Standards-Based PortletsMany vendors today support JSR168 and WSRP in many different forms.Developers have multiple options forbuilding standards-based portlets,deploying to a suitable <strong>con</strong>tainer,and testing on a portal server thatsupports the standards. As an example,let’s look at building JSR 168 portletsand rendering them on portals thatsupport WSRP.The example below uses a portletwizard that runs on top <strong>of</strong> a portlet<strong>con</strong>tainer. The wizard simplifies portletdevelopment by creating a “hello”portlet skeleton and provides thebasic import statements and methodsfor rendering the application as a portlet.The result is the same as writinga “hello world” portlet manuallyand is very similar to any standardJSP, with a few differences such as animport <strong>of</strong> javax.portlet, use <strong>of</strong> Portlet-Config, and portlet styles (portletfont).The end result <strong>of</strong> this portlet is“Welcome, this is the show mode” (seeListing 1).Once this JSP is deployed to a JSR168 portlet <strong>con</strong>tainer, it is interoperable.The nice feature about WSRPis the remote portlet capability. Theportlet is deployed in one central locationand available to multiple portalsat the same time without movingthe application to each portal server.The portal server communicates tothe producer using a WSDL URL (seeFigure 3). An example is http://myserver.mydomain.com:8888/myapp/portlets?WSDL.Using the WSDL URL, with an outputsimilar to the one below, the portalserver can ascertain registration propertiesand <strong>con</strong>figuration mappings (seeListing 2).Now it’s easy for developers to addtheir business logic to the portlet andbuild a fully functional enterpriseapplication. The Java code is the mostimportant piece from a developmentperspective; however, from a deploymentperspective, it’s important tonote the definition file that defines anddescribes the portlets. This file is calledportlet.xml and Listing 3 shows howthis file maps the <strong>con</strong>tainer to yourapplications.Figure 2 Partner A creates the Weather and News Portlet onceand it’s accessible to all <strong>of</strong> the portal vendors they support.Figure 3 Registration <strong>of</strong> remote producers using WSRP registration pagewww.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200519


PortletsConsiderations for Enterprise PortalImplementationsPortal vendors will need some timeto incorporate standards specificationsinto their particular solutions. Thus,what should organizations <strong>con</strong>siderwhen evaluating a portal solution? Howshould they prepare to migrate to astandards-based portal?First, organizations must <strong>con</strong>siderportal vendors that actively participatein and support both standards.Most likely, the participating vendor’srequirements will be embodied withinthe specifications. Se<strong>con</strong>d, companiesmust <strong>con</strong>sider a portal solution whosearchitecture supports federated portalsand resembles that <strong>of</strong> a standardsbasedportal. Finally, organizationsmust look for vendors that support bothstandards-based and nonstandardsbasedportlets within their portal <strong>of</strong>ferings.Companies will want to preservetheir existing investment in portlets andnot be burdened with huge developmentcosts when migrating over to astandards-based enterprise portal.ConclusionThe proliferation <strong>of</strong> multiple portalplatforms within an organization hasmade it difficult to integrate and standardizeinto one portal framework. Portalstandards such as WSRP and JSR 168provide organizations with a solution forenabling portal interoperability. Thesecomplementary standards provide thefacilities that allow portlets built for oneplatform to be reused within anotherstandards-based portal deployment.Companies that are evaluatingportal products must <strong>con</strong>sider vendorsthat <strong>of</strong>fer support for thesestandards and thus avoid beinglocked into proprietary <strong>sys</strong>tems.By deploying standards-based enterpriseportals, organizations can notonly leverage existing investmentsand reduce development costs, butalso extend their portal functionalityusing other standards-basedtechnologies.Resources• OASIS/WSRP committee andspecifications: www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp• JCP public JSR 168 site: www.jcp.org/en/jsr/detail?id=168Listing 1Welcome, this is the mode.Listing 2Listing 3A very simple portlet.HelloWorldHello World Portletoracle.portal.portlet.sample.HelloWorldPortlet-1text/htmledithelpaboutpreviewedit_defaultsenHello World PortletHelloHello, World, Portlet. . . . .20 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


FeatureSOA Solutions with J2EEUsing different technical and functional requirementsby Bruno ColletBruno Collet is a seasonedJ2EE architect with five years<strong>of</strong> experience. He recentlyfounded Studio 184 (www.studio184.com), where he isdeveloping the ApolloNewsnews aggregator. Bruno holdsa masters in computer sciencefrom ULB (Belgium), as well asseveral industry certifications(www.brunocollet.com).brunocollet@brunocollet.comThroughout this article I’ll describe how an effectiveservice-oriented architecture (SOA) can be achieved usingJ2EE technologies. In particular, I’ll focus on which J2EEcomponent types and communication channels to chooseaccording to specific, real-world situations.Description <strong>of</strong> the Example SystemTo illustrate an SOA <strong>sys</strong>tem made <strong>of</strong> J2EE technologies,nothing is better than a good old example. Figure 1 depictsthe main situations that can arise in a realistic SOA <strong>sys</strong>tem.A component stereotype indicates the type <strong>of</strong> client orservice; a dependency stereotype indicates the communicationtype, either as a technology (such as Web services) oras a protocol (such as CORBA IIOP); and a no dependencystereotype indicates RMI communication.The <strong>sys</strong>tem allows client <strong>sys</strong>tems to process an order (serviceOrderWorkflow), manage customers (service Customer),and produce reports (service Reporting). The OrderWorkflowservice checks product availability and retrieves productdetails (service Product), creates a new customer if needed(service Customer), and orders the selected products (serviceOrder). The Order service persists the order (service Order-Data), manages the payment (service Payment), and triggerssome process in a legacy <strong>sys</strong>tem (service BackOfficeOrder).Service LayersServices differ according to multiple criteria. Whether theservice is business oriented, public or private, or stateful orstateless dictates what layer the service is in and ultimatelyhow it is implemented and what interfaces it exposes.Top-layer services such as OrderWorkflow are coarsegrainedbusiness services, <strong>of</strong>ten stateful, that depend on oneor more finer-grained stateless business services. Bottomlayerservices are fine grained and data oriented, not businessoriented.Services are also separated into public and private services.Public services are services that are available outside<strong>of</strong> the <strong>sys</strong>tem, and possibly outside <strong>of</strong> the organization.They are typically services that have a business meaning.Private services have no business meaning; they exist tosupport business services and there’s no point in makingthem available to other <strong>sys</strong>tems. In Figure 1, public servicesare colored in blue and private services are not colored.Although the number <strong>of</strong> layers <strong>of</strong> an SOA <strong>sys</strong>tem isarbitrary, we can categorize them and associate usual J2EEcomponent types to them as shown in Table 1.Service Communication InterfacesIn SOA <strong>sys</strong>tems, service interfaces are even more importantthan service implementations, because interoperabilityessentially depends on the communication technologiessupported by the service interfaces. Remember one <strong>of</strong> thefounding principles <strong>of</strong> service architecture: the serviceimplementation is separated from the service interface(s).To <strong>con</strong>tinue this discussion, we’ll distinguish between“internal” and “external” clients. A client is internal if theorganization <strong>con</strong>trols the network path between the clientand the service. In all other cases the client is external.This distinction is driven by the fact that firewalls might belocated between the external client and the service, and noService LayerExample Business workflowOrderWorkflow BusinessOrder Data and enterpriseresourcesTable 1 J2EE component type according to service layerSOA ReminderJ2EE Component Typestateful session EJBstateless session EJBentity EJB/Data Access Object/resource/adapter OrderDataSOA promotes loosely coupled, distributable, reusable services that canbe invoked through platform-independent service interfaces. A service is afunction that is well defined, self-<strong>con</strong>tained, and does not depend on thestate <strong>of</strong> other services.SOA is not a technology, an implementation, or a design pattern; it is anarchitectural paradigm. For example, Web services is a technology-enablingSOA implementation. But Web services is not the only way to implement anSOA <strong>sys</strong>tem and does not guarantee that the <strong>sys</strong>tem will be SOA-compliant.Resources• SOA Blueprints Concepts: www.middlewareresearch.com/endeavors/artifacts/soa-blueprints/SOA_Blueprints_Concepts_v0_5.pdf• Web Services and SOA: www.service-architecture.com/index.html22 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


RMI over HTTPRMI works over JRMP (Java Remote Methods Protocol) and IIOP. The J2EEspecification requires HTTP tunneling, meaning that RMI calls go throughHTTP instead <strong>of</strong> JRMP. As firewalls let HTTP pass through, that solves thecommunication problem. Unfortunately, the degradation <strong>of</strong> performanceis such that it is better to use Web services than HTTP tunneling. Moreover,HTTPS tunneling is not required in the J2EE specification, which is a serioussecurity issue unless we choose to manage security programmatically.Resource• Access EJBs Through Firewalls: www.ftponline.com/javapro/2002_09/online/j2ee_asankaran_09_03_02/assumption can be made on which ports the firewall keepsopen and which protocols the firewall lets pass, except thatit allows text over HTTP. In particular, this is true if the clientcomponent is located on the Internet.The major <strong>con</strong>dition to decide on in a service interfacetechnology is whether the service clients are internal or not. InFigure 1, external clients are red and internal clients are green.ExternalMainClient uses the Internet. As mentioned earlier,this causes severe restrictions as to which ports and protocolsare available for communication. For example, communicatingin RMI or IIOP is not realistic, since most firewalls will not letthese protocols go through. In such a situation, only text-basedprotocols over HTTP (or HTTPS) should be <strong>con</strong>sidered.Web services, a standardized technology that leverages the<strong>con</strong>venience <strong>of</strong> XML as text over HTTP, is the best technologyavailable, provided that the client platform supports Web services.The .NET client from our example understands Web services.If it were not the case, we would have had to downgrade thecommunication to, for example, plain XML text over HTTP, withcustom XML generation and parsing on the client side.Now let’s have a look at internal clients. OrderClient isa J2EE application client using RMI to communicate withOrderWorkflow. Why RMI and not Web services? Isn’t Webservices the most cool technology that every supportingplatform should use when possible? Well, no. Using Webservices between “internal” J2EE components has a heavyperformance toll. Performance, which is a critical factor formost <strong>sys</strong>tems, is much more favorable to RMI than to Webservices. It must be noted that Web services still has opportunitiesfor significant optimizations, but current Web servicesimplementations are notoriously slower than RMI.The golden rule is: if a J2EE service only has internal J2EE orJava clients, stick to RMI, but if you can’t make this assumption,<strong>con</strong>sider Web services.This rule can be understood witha bit <strong>of</strong> logic: the closer the interface technology is to theimplementation technology, the less work that has to be doneto translate between the two. For example, XML, which Webservices messages are made <strong>of</strong>, is farther from Java than RMIis. The gap between XML types and Java types is wider thanthe gap between CORBA IIOP types and Java types, which inturn is wider than the gap between RMI types and Java types.To generalize this rule, we can say that the more interoperablea technology is, the slower it tends to be. Although technologyimplementations can provide exceptions to this rule, the ruleremains true in the vast majority <strong>of</strong> cases.Each situation requires a decision based on the trade-<strong>of</strong>fbetween interoperability and performance.Fortunately, interoperability and performance benefitscan be combined thanks to the fact that a service can havemore than one interface. OrderWorkflow is a good example.While its implementation <strong>of</strong> the application logic is devel-ExternalMainClientOrderClientMarketingOrderWorkflowReportingProductOrderCustomerProductDataBackOfficeOrderOrderDataPaymentCustomerDataFigure 1 The <strong>sys</strong>temwww.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200523


Featureoped only once, the service presents two different interfaces: oneRMI and one Web services.Moreover, with the right tools, service interfaces can be generatedautomatically from one another. For example, a tool such asCastor XML or a JAXB implementation can generate Java classesfrom the XML Schemas. The RMI interface is thus generated withminimal hand coding. Enabling Web services as EJB endpoints isalso a good alternative.OrderWorkflowWSOrderWorkflowFigure 2 OrderWorkflow componentCORBAExternalMainClientOrderClientOrderWorkflow DelegateOrderWorkflowEJBCommon Object Request Broker Architecture might be said to be the first SOAimplementation because it embraces the very same goals as SOA. However, it’s not asinteroperable as Web services is because it doesn’t usually go through firewalls andit’s not supported by Micros<strong>of</strong>t platforms (MS developed COM and DCOM as their ownflavors <strong>of</strong> CORBA). CORBA protocol is Internet Inter-ORB Protocol (IIOP). The interfacesto CORBA services are defined in the Interface Description Language (IDL), which mapsto popular languages such as C, C++, Java, Ada, and Python. The languages supportingCORBA are interoperable. RMI is based on IIOP but is specific to Java. Therefore it’snatural to <strong>con</strong>sider using IIOP before any other protocol if RMI cannot be used.Resources• CORBA FAQ: www.omg.org/gettingstarted/corbafaq.htm• Java, RMI & CORBA: A comparison <strong>of</strong> two competing technologies: www.javac<strong>of</strong>feebreak.com/articles/rmi_corba/• CORBA vs Web Services: www2002.org/CDROM/alternate/395Figure 2 focuses on the OrderWorkflow service to illustrate howa single service is accessed through two communication channels.ExternalMainClient accesses the service through its Web servicesinterface, which in terms <strong>of</strong> J2EE component types is a Web applicationresource (WAR). Upon receiving a Web services request, theWAR makes an ordinary Java method call to the business delegatelocated in the JAR, which in turn makes an RMI call to the EJB.In <strong>con</strong>trast, the local OrderClient J2EE client directly calls thedelegate without going through the WAR. The service businesslogic is located in the EJB-JAR component, and the WAR implementsa Web services interface layer above the ordinary businessdelegate. Both interfaces share exactly the same business logic.This design pattern ensures a multiple-communication-channelSOA as well as the scalability, distributability, and other capabilitiesprovided by the EJB technology.The marketing application is a C legacy application that callsthe reporting component to present statistical data to the user.Marketing is an internal client, but does not support RMI. CORBAis an effective and mature distributed architecture available toboth C and J2EE platforms. Again, the reason for choosing CORBAover Web services is the performance. As a general rule, internalcomponents should not communicate through Web servicesunless some other capability <strong>of</strong> Web services, such as the UDDIpublish-discover mechanism, for example, is a deciding factor.Sometimes we have to deal with a component that does notsupport any high-level communication technology. In this case,only low-level protocols remain. The Order service accesses theBackOfficeOrder legacy <strong>sys</strong>tem by writing XML text on a TCP socket.BackOfficeOrder is nonetheless a service, but its interface is veryrestrictive in terms <strong>of</strong> communication technology and messageformat. Unfortunately, this situation is rather common. Access toBackOfficeOrder is managed through a resource adapter (Java ConnectorArchitecture technology), a special kind <strong>of</strong> data source.Communication Interface SummaryFigure 3 is a chart that summarizes the decision process forselecting an appropriate interface communication technology accordingto most usual situations. Alternatives such as JINI, HTTPtunneling, middleware <strong>sys</strong>tems, and the proprietary technologies<strong>of</strong> application servers are not covered.Other ConsiderationsAsynchronous ServicesUntil now we’ve discussed only synchronous services. Indeed,does client support Web Services?yes:use Web Servicesuse plain text (XML) over HTTPyes:no:yes:is client external?no:does client support HTTP and XML?no:use plain text over TCP socketno:does client support RMI?no:does client support some high-level communication such as CORBA IDL?yes:use CORBA or other communication technologyyes:use RMIFigure 3 Choosing a communication interface24 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


ReportingWSReportingExternalMainClientReportingQueueFigure 4 Reporting asynchronous componentMarketingReportingDelegateReportingEJBProvides a method to accept the requestand a method to receive the callback toget the response.Contains a stateless session EJB to enqueuethe request, a message-driven EJB todequeue the request, and a stateless sessionEJB to process the request and place theresponse in se<strong>con</strong>dary storage.RMI, CORBA, and Web services are inherently synchronous. Asynchronousservices bring interesting capabilities when the time to perform anoperation is likely to exceed the time that the client component is willingto wait. It also allows event-driven processes. Java Message Service (JMS)is the J2EE technology providing asynchronous capability.In Figure 4, ExternalMainClient calls the Reporting service via Web services,and the marketing legacy application accesses the service via CORBAIIOP. For Reporting, the messaging queue is not visible for the client.Instead, to provide a degree <strong>of</strong> abstraction, producers and <strong>con</strong>sumers arehidden under Web services and RMI interfaces. To switch from synchronoustechnologies such as Web services and CORBA to asynchronous JMS,the producer EJB generates a token that is immediately sent back to theclient. After the reporting process is completed for a request, the response(the report) is placed in se<strong>con</strong>dary storage (in a database, for example). Theclient can call back with its token at any time to check whether the reportis ready. If it is, the report is sent back to the client. Alternatively, the clientcomponent could provide the server with a callback <strong>sys</strong>tem, so that theserver automatically sends the response to the client when the job is done.Publish and DiscoverSOA also promotes publishing and discovery <strong>of</strong> services. Publishingservices is useful when we need very loose client/server relationships.In other words, it’s important if the clients don’t know where and how toreach the service directly. For example, if we set up a free news servicethat any client can use, we would publish the service so that any client isable to discover it and get a description <strong>of</strong> its message formats. In mostother situations, the publish-discover mechanism is <strong>of</strong> little use. In theexample <strong>sys</strong>tem, the client/server relationships are static, as is usually thecase in intraorganization <strong>sys</strong>tems, and makes publish-discover irrelevant.For Web services, publish-discover is provided by UDDI. No such mechanismexists in RMI, but, although it would not comply with any standard,it’s easy to design an entry point that provides clients with the localizationand interface descriptions <strong>of</strong> EJBs and other resources.TransactionsAs a small reminder, atomic transactions are a well-known techniquefor guaranteeing <strong>con</strong>sistency in the presence <strong>of</strong> failures. The ACIDproperties <strong>of</strong> atomic transactions (Atomicity, Consistency, Isolation,and Durability) ensure that even in complex business applications, <strong>con</strong>sistency<strong>of</strong> state is preserved despite <strong>con</strong>current accesses and failures.In an SOA <strong>sys</strong>tem transaction, demarcation typically defines whether aservice creates a new transaction, uses an existing transaction, or does notsupport transactions. In our <strong>sys</strong>tem, OrderWorkflow automatically startsa new transaction and all underlying services (Product, Order, Customer)use it. If at the end <strong>of</strong> the transaction the process <strong>of</strong> creating the order fails,the creation <strong>of</strong> the customer is rolled back and data integrity is preserved.Support for transaction management differs according to communicationtechnologies. RMI does support all that is needed, so that is again astrong point <strong>of</strong> RMI. Web services does not support transactions out <strong>of</strong> thebox. There are, however, proprietary extensions, and a couple <strong>of</strong> extensions-in-the-makingby Sun, OASIS, and others. This restriction meansthat a transaction started by the Web services client cannot be propagatedto the Web services service, but the service is still able to start its owntransaction as OrderWorkflow does.RMI is CORBA-based; it’s theoretically feasible to propagate a CORBAtransaction to an RMI service and vice versa, but the lack <strong>of</strong> support forthe specification makes it difficult at best.To make things worse, it is notorious that transactions managementacross J2EE servers from different vendors is not seamless, due to thelack <strong>of</strong> compliance with the J2EE specification.SecurityJ2EE provides authentication, authorization, and encryption. We canthus build secure channels between J2EE components.For the same reason as for transaction management, interoperability<strong>of</strong> security mechanisms between CORBA and J2EE is far less obviousthan the theory suggests.As for Web services, current security capabilities are those <strong>of</strong> HTTP, becauseWeb services works over HTTP. It means that Web services securitycan make use <strong>of</strong> SSL authentication and encryption, and this is enoughfor most business applications. When reaching a J2EE <strong>con</strong>tainer, the <strong>con</strong>tainerauthenticates the user/password received via HTTP and retrievesuser credentials to check authorization when the transaction wants toaccess protected resources.ConclusionThe most important <strong>con</strong>clusion is that, because it has a significantperformance cost, interoperability is not always desirable. To alleviate thishard truth, remember that a service can implement more than one interface,achieving interoperability as well as decent performance for a littleextra work.Also, it must be noted that the component approach underlying J2EE iswell suited for SOA. For RMI services in particular, applying common designpatterns such as session facade, business delegate, and service locatorto EJB-based services enables compliance with all SOA principles exceptinteroperability. This makes EJB-based services a great solution for SOA ina J2EE environment.Even as we have seen that Web services technology is far from being amagic bullet for SOA <strong>sys</strong>tems, it is nonetheless the most effective technologyto expose services when no assumption can be made as to the platformor the location <strong>of</strong> the client/server components, which is a commonsituation for top-layer business services. In other words, Web services isthe best solution when interoperability is a requirement.Resources and Further Readings• Exposing EJB Components as Business Services: An Architect’s View: www.oracle.com/technology/pub/articles/davydov_ejb.html• SOA Blueprints: www.middlewareresearch.com/soa-blueprints/• Comparing Web Service Performance: www.sosnoski.com/presents/cleansoap/comparing.html• Fast Web Services: http://java.sun.com/developer/technicalArticles/WebServices/fastWS/• Web Services Transaction Management Specification: http://developers.sun.com/techtopics/ webservices/wscaf/wstxm.pdf• RMI/IIOP, nice idea but the reality is turning out to be different: www.theserverside.com/articles/article.tss?l=RMI-IIOP• Web Services Security: http://webservices.xml.com/pub/a/ws/2003/03/04/security.htmlwww.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200525


BluetoothDeveloping Wireless BluetoothApplications in J2MEby Peter V. MikhalenkoPortable, secure, and highly usablePeter Mikhalenko holds amasters in computer sciencefrom Moscow State University.He has made code <strong>con</strong>tributionsto several worldwideopen source projects and haswritten many articles on XMLand Java. Peter is a Suncertified pr<strong>of</strong>essional andworks in Deutsche Bank codevelopinga financetransactional <strong>sys</strong>tem.peter@mikhalenko.ruMobile communicationcomes into our daily livesvery quickly, and as <strong>of</strong> todayseveral wireless technologieshave become standard. In this article I’llbriefly review Bluetooth principles andthe principles <strong>of</strong> Java development forBluetooth on mobile devices.The Java APIs for the Bluetooth wirelesstechnology (JABWT) standard, definedby the JSR 82 specification (www.jcp.org/en/jsr/detail?id=82), supportsthe rapid development <strong>of</strong> Bluetooth applicationsthat are portable, secure, andhighly usable. Wireless device manufacturershave responded to the JABWTspecification by announcing mobilephones and other products that will runJABWT applications.What Is Bluetooth?According to the latest Bluetooth 1.2specification (www.bluetooth.org/spec/), Bluetooth wireless technology isa short-range communications <strong>sys</strong>temthat’s intended to replace the cable(s)<strong>con</strong>necting portable and/or fixedelectronic devices. The Bluetooth core<strong>sys</strong>tem <strong>con</strong>sists <strong>of</strong> a radio frequency(RF) transceiver, baseband, and protocolstack. The <strong>sys</strong>tem <strong>of</strong>fers services thatenable the <strong>con</strong>nection <strong>of</strong> devices andthe exchange <strong>of</strong> a variety <strong>of</strong> classes <strong>of</strong>data between these devices. Actually it’sa wireless communication protocol that,like HTTP or FTP, operates in a client/server architecture. It uses the 2.4 GHzband known in the U.S. as the Industrial-Scientific-Medical(ISM) band. The802.11b wireless LAN protocol operatesin this band as well, although they areintended for different needs and don’tinterfere with each other.Bluetooth ArchitectureBluetooth is a completely differentway to communicate compared tocables, since during a typical operationa physical radio channel is shared bya group <strong>of</strong> devices that are synchronizedto a common clock. One deviceprovides the synchronization referenceand is known as the master. All otherdevices are known as slaves. A group <strong>of</strong>devices synchronized in this way form aso-called pi<strong>con</strong>et. A master and a singleslave use point-to-point communication;if there are multiple slaves, pointto-multipointcommunication is used.A master unit is the device that initiatesthe communication. A device in onepi<strong>con</strong>et can communicate to anotherdevice in another pi<strong>con</strong>et, forming ascatternet. The physical channel is subdividedinto time units known as slots.Data is transmitted between Bluetoothdevices in packets that are positioned inthese slots. Above the physical channelthere is a layering <strong>of</strong> links and channelsand associated <strong>con</strong>trol protocols. Thehierarchy <strong>of</strong> channels and links fromthe physical channel upward <strong>con</strong>sists<strong>of</strong> a physical channel, a physical link,logical transport, a logical link, and aL2CAP channel. In Figure 1 we can see ahigh-level view <strong>of</strong> the architecture <strong>of</strong> theBluetooth protocol stack.The radio layer is the physical wireless<strong>con</strong>nection. To avoid interferenceFigure 1 Bluetooth protocol stackwith other devices that communicate inthe ISM band, the modulation is basedon fast frequency hopping. Bluetoothdivides the 2.4 GHz frequency band into79 channels, 1 MHz apart (from 2.402to 2.480 GHz), and uses this spreadspectrum to hop from one channel toanother, up to 1,600 times per se<strong>con</strong>d.The baseband layer is responsible for<strong>con</strong>trolling and sending data packetsover the radio link. It provides transmissionchannels for both data andvoice. The baseband layer maintainsSynchronous Connection-Oriented(SCO) links for voice and AsynchronousConnectionless (ACL) links for data.SCO packets are never retransmittedbut ACL packets are to ensure dataintegrity. The Host Controller Interface(HCI) <strong>con</strong>trols the low-level operation<strong>of</strong> the radio and is the interface betweenthe Bluetooth device and the hostcomputer. Logical Link Controller AdaptationProtocol (L2CAP) multiplexesall data passing through the Bluetoothdevice. However, audio signals havedirect access to the HCI. The ServiceDiscovery Protocol (SDP) finds serviceson remote Bluetooth devices. RFCOMMis widely known as the virtual serial portprotocol, because it allows a Bluetoothdevice to simulate the functionality <strong>of</strong> aserial port.At the application level it can be anyapplication that needs to exchange datathrough a wireless <strong>con</strong>nection. ObjectExchange Protocol (OBEX) is widelyused and allows you to exchange objectdata (such as files). It’s interesting thatthe Object Exchange (OBEX) API wasdeveloped by Java enthusiasts andbecame a subpackage <strong>of</strong> JSR 82.Bluetooth InteractingBluetooth pr<strong>of</strong>iles exist to ensureinteroperability among Bluetooth-enableddevices and applications from26 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


different manufacturers and vendors.A pr<strong>of</strong>ile defines the roles and capabilitiesfor specific types <strong>of</strong> applications.Bluetooth devices cannot interactunless they <strong>con</strong>form to a particularpr<strong>of</strong>ile. There are a number <strong>of</strong> differentpr<strong>of</strong>iles in a Bluetooth specification,such as Synchronization, Serial Port,and LAN Access. The SynchronizationPr<strong>of</strong>ile defines the application requirementsfor Bluetooth devices that needto synchronize data on two or more devices.The Serial Port Pr<strong>of</strong>ile defines therequirements for Bluetooth devices thatneed to set up <strong>con</strong>nections that emulateserial cables and use the RFCOMMprotocol. The LAN Access Pr<strong>of</strong>ile defineshow Bluetooth devices can access theservices <strong>of</strong> a LAN using PPP, and showshow PPP mechanisms can be used t<strong>of</strong>orm a network <strong>con</strong>sisting <strong>of</strong> Bluetoothdevices.Security is provided in three ways:pseudo-random frequency hopping,authentication, and encryption. Frequencyhops make it difficult for anyoneto eavesdrop. Authentication allows auser to limit <strong>con</strong>nectivity to specifieddevices. Encryption uses secret keys tomake data intelligible only to authorizedparties.Java APINow we can see how easy it is to<strong>con</strong>nect two devices with Bluetoothusing Java. The Java Bluetooth APIrelies on the Java Generic ConnectionFramework, which limited it to J2MEfor a long time. However, now it’s beenproposed to include GCF in J2SE, andthe Bluetooth API can be made accessiblefor a broader range <strong>of</strong> <strong>sys</strong>tems.The Java APIs for Bluetooth define twopackages: javax.bluetooth for the coreBluetooth API and javax.obex for theObject Exchange (OBEX) protocol.Any Bluetooth application has thesecomponents: stack initialization, devicemanagement, device discovery, servicediscovery, and communication. Accordingto JSR 82, the underlying Bluetooth<strong>sys</strong>tem must support a BluetoothControl Center (BCC), a <strong>con</strong>trol panelmuch like the application that allows auser or OEM to define specific valuesfor certain <strong>con</strong>figuration parameters ina stack. In particular, it will be used in astack initialization.Stack InitializationPrior to starting wireless communicationthe Bluetooth device should beinitialized. This is done in a vendor-dependentway, and exact steps for stackinitialization are beyond the scope <strong>of</strong>the Bluetooth API specification. Asshown by Bruce Hopkins, the author<strong>of</strong> Bluetooth for Java, in his article“Getting Started with Java and Bluetooth”(http://today.java.net/pub/a/today/2004/07/27/bluetooth.html),it isdone using several settings in the AtinavJava Bluetooth SDK (see Listing 1). It isimportant that these calls are not part<strong>of</strong> JSR 82. Other JSR 82 implementationsmay incorporate other ways to initializethe stack.Device ManagementThe JSR 82 API introduces two classesthat can be used for device management:LocalDevice to request staticinformation about the Bluetooth device,and RemoteDevice to retrieve informationabout devices in the Bluetoothneighborhood, e.g., a remote deviceBluetooth Address. LocalDevice dependson the javax.bluetooth.Device-Class class to retrieve the device’s typeand the kinds <strong>of</strong> services it <strong>of</strong>fers. TheRemoteDevice class represents a remotedevice (a device within a range <strong>of</strong>reach) and provides methods to retrieveinformation about the device, includingwww.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200527


Bluetoothits Bluetooth address and name. EveryBluetooth device has a unique hardwareaddress, like the MAC address for computers.You can set the level <strong>of</strong> devicediscovery, enabling other Bluetoothdevices to find the current device bycalling the setDiscoverable() method inthe LocalDevice object (see Listing 2).Device DiscoveryWireless devices need a mechanismthat allows them to find other devicesand gain access to their capabilities. Thecore Bluetooth API’s DiscoveryAgentclass and DiscoveryListener interfaceprovide the necessary discovery services.There are three ways to obtain alist <strong>of</strong> accessible devices. The DiscoveryAgent.startInquiry()method placesthe device into an inquiry mode. To takeadvantage <strong>of</strong> this mode, the applicationmust specify an event listener thatwill respond to inquiry-related events.DiscoveryListener.deviceDiscovered()is called each time an inquiry findsa device. When the inquiry is completedor canceled, DiscoveryListener.inquiryCompleted() is invoked. If thedevice doesn’t wish to wait for devices tobe discovered, it can use the DiscoveryAgent.retrieveDevices()method toretrieve an existing list. Depending onthe parameter passed, this method willreturn either a list <strong>of</strong> devices found in aprevious inquiry or a list <strong>of</strong> preknowndevices that the local device has told theBluetooth Control Center it will <strong>con</strong>tactfrequently. The most simple approachis shown in Listing 3 where Discovery-Agent is asked for an object to notifyus via the DiscoveryListener interfacewhenever it detects a new Bluetoothdevice.Service DiscoveryService discovery allows you to findnearby services, regardless <strong>of</strong> what devicesare <strong>of</strong>fering them. Because servicediscovery is much like device discovery,DiscoveryAgent also provides methodsto discover services on a Bluetoothserver device and to initiate service-discoverytransactions. Before a service canbe discovered, it must first be registered– advertised on a Bluetooth serverdevice. The server is responsible for creatinga service record that describes theservice <strong>of</strong>fered, accepting <strong>con</strong>nectionsfrom clients, adding a service record tothe server’s Service Discovery Database(SDDB), etc. In general it works similarto Web services. Listing 4 provides anexample <strong>of</strong> a service registration.CommunicationThe two devices must share a commoncommunications protocol. Applicationscan access a wide variety <strong>of</strong>Bluetooth services because the Java APIsfor Bluetooth provide mechanisms thatallow <strong>con</strong>nections to any service thatuses RFCOMM, L2CAP, or OBEX as itsprotocol. If a service uses another protocol(such as TCP/IP) layered above one <strong>of</strong>these protocols, the application can accessthe service, but only if it implementsthe additional protocol in the applicationusing the CLDC Generic ConnectionFramework. The URL used as a servicerecord <strong>con</strong>sists <strong>of</strong> digits and symbolsand may look something like btspp://5080312050801<strong>10</strong>F1B1B1D1C<strong>10</strong>0:8.This means that a client should use aBluetooth Serial Port Pr<strong>of</strong>ile (btspp://) toestablish a <strong>con</strong>nection to server channel8 on a device with the address 5080312050801<strong>10</strong>F1B1B1D1C<strong>10</strong>0. Device addressesare similar to the physical (MAC) addresses<strong>of</strong> computers. Simple RFCOMM<strong>con</strong>nections look like Listing 5.Resources• JSR 82, Java API for Bluetooth: www.jcp.org/en/jsr/detail?id=82• Bluetooth 1.2 specification: www.bluetooth.org/spec/• Hopkins, B., and Antony, R. (2003).Bluetooth for Java. Apress.• “Getting started with Java andBluetooth”: http://today.java.net/pub/a/today/2004/07/27/bluetooth.htmlListing 1import javax.bluetooth.*;import javax.microedition.io.*;import com.atinav.bcc.*;BCC.setPortName("COM1");BCC.setBaudRate(57600);BCC.setConnectable(true);BCC.setDiscoverable(DiscoveryAgent.GIAC);Listing 2// retrieve the local Bluetooth device objectLocalDevice local = LocalDevice.getLocalDevice();// retrieve the name <strong>of</strong> the local Bluetooth deviceString name = local.getFriendlyName();Listing 3LocalDevice localdevice = LocalDevice.getLocalDevice();DiscoveryAgent discoveryAgent = localdevice.getDiscoveryAgent();discoveryAgent.startInquiry(DiscoveryAgent.GIAC, this);Listing 4// Service registration// invoke Connector.open with a server <strong>con</strong>nection URL argumentStreamConnectionNotifier service =(StreamConnectionNotifier) Connector.open("someURL");// Obtain the service record created by the server deviceServiceRecord sr = local.getRecord(service);// Indicate that the service is ready to accept a client <strong>con</strong>nection.acceptAndOpen() blocks// until a client <strong>con</strong>nects.StreamConnection <strong>con</strong>nection =(StreamConnection) service.acceptAndOpen();// DO SOME EXCHANGE HEREservice.close();Listing 5String url =serviceRecord.getConnectionURL(record.NOAUTHENTICATE_NOENCRYPT, false);// open a <strong>con</strong>nection to the serverStreamConnection <strong>con</strong>nection =(StreamConnection) Connector.open(url);// Send/receive datatry {byte buf[] = new byte[200];String msg = "Test message";InputStream is = <strong>con</strong>nection.openInputStream();OutputStream os = <strong>con</strong>nection.openOutputStream();// send data to the serveros.write(msg.getBytes);// read data from the serveris.read(buf);<strong>con</strong>nection.close();} catch(IOException e) {e.printStackTrace();}28 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


FeatureJAVA TECHNOLOGYToys or tools?FORTHEWIRELESS INDUSTRYby David Parsons, Ilan Kirsh,and Mark CranshawDavid Parsons is asenior lecturer ininformation <strong>sys</strong>tems atMassey University, Auckland,and a knowledge engineerfor S<strong>of</strong>tware EducationAssociates, Wellington.Until last year he wasthe director <strong>of</strong> emergingtechnologies at Valtech,London, and prior tothat, principal technologistat BEA Systems.d.p.parsons@massey.ac.nzThe Java Technology for the Wireless Industry specification(JTWI) encompasses a standard set <strong>of</strong> J2MEAPIs for mobile device development that is beingwidely adopted by mobile telephone service providers,making it an important platform for Java developers.Its core component, the Mobile Information DevicePr<strong>of</strong>ile (MIDP), provides a number <strong>of</strong> specialized librariesfor multimedia and games development; however,its underlying subset <strong>of</strong> general purpose Java classes isstrictly limited. In addition, support for persistence viathe Record Management System is relatively poor. Thisraises an important question: Is JTWI a realistic applicationdevelopment tool or is it only good for games andother s<strong>of</strong>tware trivia?In this article, we try to answer this question by exploringthe viability <strong>of</strong> MIDP as a tool for nontrivial applicationdevelopment. An enterprise application that includesmobile components might reasonably expect to devolvesome <strong>of</strong> its business processes and data management tomobile devices. Our chosen example, which <strong>con</strong>siders both<strong>of</strong> these aspects, is a proposed implementation <strong>of</strong> the JavaData Objects (JDO) specification. This includes a number <strong>of</strong>interesting features that highlight the <strong>con</strong>straints <strong>of</strong> workingwith J2ME APIs for limited devices. We describe the issuesaround the development <strong>of</strong> such an implementation andthe limitations that MIDP imposes, suggest some usefulworkarounds and architectural options, and finally drawsome <strong>con</strong>clusions about the usefulness <strong>of</strong> JTWI as a set <strong>of</strong>APIs for serious application development.IntroductionHandheld computers, such as the Pocket PC and the Palm,can support reasonably complete Java Application ProgrammingInterface (API) sets that can be used to develop seriousenterprise applications. However, smaller devices, such asmobile telephones, only support Java APIs that have beensignificantly reduced to work within the <strong>con</strong>fines <strong>of</strong> limitedhardware. There is no support for the types <strong>of</strong> persistencemechanisms that we have come to expect on larger Java platforms.The question we address in this article is whether themobile telephone is a viable platform yet for serious businessor scientific applications that need to store and process datalocally and that expect the services <strong>of</strong> a reasonably rich set <strong>of</strong>Java APIs.To date, we have seen <strong>con</strong>siderable development inareas such as mobile games development, but more seriousbusiness and scientific applications will need to be developedif JTWI is to be a useful component <strong>of</strong> enterprises<strong>of</strong>tware <strong>sys</strong>tems. Since such <strong>sys</strong>tems are likely to require<strong>con</strong>siderable support for persistence, we focus on the JDOspecification and examine some potential issues that arisewhen attempting to implement this specification usingMIDP. We extrapolate from this analysis to assess the generalusefulness <strong>of</strong> MIDP as a general purpose applicationprogramming platform. We also look at how MIDP devicesfit into larger distributed architectures that can mitigatethe limitations <strong>of</strong> mobile telephones as Java applicationplatforms.The Java 2 Micro Edition (J2ME)To cater to a wide range <strong>of</strong> small devices and applicationrequirements, the J2ME architecture (see Figure 1) providesmultiple <strong>con</strong>figuration and pr<strong>of</strong>ile layers that overlaythe specialized Java Virtual Machine (JVM) and operating<strong>sys</strong>tem. Configurations define the minimum set <strong>of</strong> availableJVM features and class libraries for a specific category<strong>of</strong> device and are hardware focused; pr<strong>of</strong>iles define the set<strong>of</strong> APIs available for a particular market category <strong>of</strong> devicesand are s<strong>of</strong>tware focused.J2ME <strong>con</strong>figurations specify the minimum requirementsfor memory, Java language features, JVM support, andruntime libraries. There are two standard J2ME <strong>con</strong>figurations:the Connected Device Configuration (CDC) and theConnected Limited Device Configuration (CLDC). For thesmallest portable devices, such as mobile telephones, thestandard <strong>con</strong>figuration is the CLDC. This <strong>con</strong>figurationrequires a very small virtual machine, such as Sun’s KVM(Kilobyte Virtual Machine) or CLDC HotSpot Implementation,with footprints <strong>of</strong> only about 50–80K. These virtualmachines don’t have to comply with the full JVM specification,nor do they have to support the complete Java languagespecification. API support is limited to a selection<strong>of</strong> classes from a few packages from the Java 2 StandardEdition (J2SE), plus the Generic Connection Framework(GCF), comprising a hierarchy <strong>of</strong> <strong>con</strong>nection interfaces(and the Connector factory class) that are intended toprovide a generic way <strong>of</strong> expressing operations on <strong>con</strong>nectionsregardless <strong>of</strong> the actual protocol.30 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


Java Technology for the Wireless IndustryThe key goal <strong>of</strong> the JTWI specification is “to minimize APIfragmentation in the mobile phone device market, and todeliver a predictable, clear specification for device manufacturers,operators, and application developers” (http://jcp.org/aboutJava/communityprocess/final/jsr185/index.html).Thus, we can reasonably expect the next generation <strong>of</strong>Java-enabled telephones to support these technologies. Thespecifications included within JTWI are:• Mandatory specifications:–Mobile Information Device Protocol (MIDP) 2.0–Wireless Messaging API (WMA) 1.1• Optional specification:–Mobile <strong>Media</strong> API (MMAPI) 1.1• Minimum <strong>con</strong>figuration on which JTWI is built:–Connected Limited Device Configuration (CLDC) 1.0From an application development perspective, the mostimportant API is MIDP (and by implication the CLDC uponwhich it builds), since these are the APIs that provide a subset<strong>of</strong> the standard Java packages found in the Java 2 StandardEdition, along with additional APIs specifically tailored formobile development. One important issue with JTWI is that itmandates only CLDC 1.0, not CLDC 1.1, which, as we will see,introduced some important new features.Mobile Telephone J2ME ApplicationCLDC (<strong>con</strong>figuration)J2ME Virtual MachineMIDP (pr<strong>of</strong>ile)Figure 1 The APIs for MIDP developmentAdditional Packages:• javax.microedtion.midlet• javax.microedition.lcdui• javax.microedition.lcdui.game• javax.microedition.media• javax.microedition.media.<strong>con</strong>trol• javax.microedition.rms• javax.microedition.pki+ additional classes from• javax.microedition.io+ the following classes:• java.util.Timer• java.util.TimerTask• java.lang.IllegalStateExceptionSubset <strong>of</strong> classes from p ackages:• java.lang• java.lang.ref• java.io• java.util+ additional package• javax.microedition.ioJava language syntax, but:• No finalization• Limited error and exception handling• Limits to threading• No user defined class loadersThe Mobile Information Device Pr<strong>of</strong>ileThe MIDP is one <strong>of</strong> two pr<strong>of</strong>iles (the other being the InformationModule Pr<strong>of</strong>ile) that works on top <strong>of</strong> the CLDC. Itprovides graphical interfaces for interactive applications andis the standard Java pr<strong>of</strong>ile for mobile telephone developmentunder the JTWI specification.There are seven packages <strong>con</strong>taining the additional classesand interfaces <strong>of</strong> the MIDP, providing user interface featuresat two levels <strong>of</strong> portability, sound support, certificate-basedauthentication, persistence, and the MIDlet framework for deployingclasses into a MIDP environment. There are also extraclasses in the javax.microedition.io and java.util packages.The sum <strong>of</strong> APIs available to a MIDP developer will be thecombined set <strong>of</strong> classes in the CLDC and MIDP. Figure 1 summarizesthe relationships between the relevant <strong>con</strong>figurationand pr<strong>of</strong>ile APIs and the underlying J2ME JVM.What Is Missing from MIDP?To <strong>con</strong>sider how viable MIDP is as a general-purpose programmingframework, it’s useful to explore which packagesand classes are excluded from it when compared with thestandard edition. Of course, MIDP provides its own classes forgraphics and sound, so there are no AWT, Swing, or sound-relatedpackages from the standard edition. Similarly, MIDP hasits own (limited) security classes, so there are no javax.securitypackages either. Since the Generic Connection Frameworkcovers <strong>con</strong>nectivity, packages relating to CORBA and network<strong>con</strong>nections are also excluded. RMI likewise is not part <strong>of</strong>MIDP; although there is a separate J2ME RMI pr<strong>of</strong>ile, it canonly be used with the CDC <strong>con</strong>figuration, not with CLDC.Other missing packages are those that relate to JavaBeans,reflection, XML, printing, and JNDI.Although MIDP excludes many packages that are presentin the standard edition, many <strong>of</strong> these have equivalents in theMIDP packages or, like printing, are not particularly importantfor mobile devices. However, it is in those packages that areincluded in MIDP that we find the most <strong>con</strong>straining factors,since these packages have far fewer classes in MIDP than in thestandard edition. For example, MIDP includes only one interfaceand nine classes from java.util, as opposed to 14 interfacesand 41 classes in the standard edition (version 1.4), principallydue to the absence <strong>of</strong> the Java 2 Collections Framework.MIDP Persistence with RMSIn the <strong>con</strong>text <strong>of</strong> enterprise Java development, there are anumber <strong>of</strong> standard APIs that can be used to support data and/or object persistence: serialization, JDBC, Java Data Objects,and entity Enterprise JavaBeans (Enterprise Edition only). In<strong>con</strong>trast, MIDP does not automatically support any <strong>of</strong> thesepersistence mechanisms. The CLDC java.io package <strong>con</strong>tainsonly the lower-level streams, readers, and writers, and doesn’t<strong>con</strong>tain any file or object streams, or, indeed, the Serializableinterface.This means that persistence-related code in MIDP differs<strong>con</strong>siderably from other Java programming <strong>con</strong>texts and usesthe Record Management System (RMS). The RMS comprisesvariable length record stores, each <strong>of</strong> which is a collection<strong>of</strong> variable size binary data records. Each record store hasa unique name, and each record within a store has a nonreusableinteger index that acts as a primary key. Althoughindividual operations on a record store are atomic, there is notransactional support, apart from a version number, that canbe used to support manually implemented locking strategies.The Java Data Objects SpecificationThe Java Data Objects specification is an output <strong>of</strong> the JavaCommunity Process (JSR 12), which had its first final releasein April 2003. JDO defines an interface-based standard for thepersistence <strong>of</strong> domain objects. There are currently around 20vendors <strong>of</strong>fering JDO implementations with varying levels <strong>of</strong>specification compliance. JDO implementations can be usedwith a range <strong>of</strong> data stores and across all three editions <strong>of</strong> theJava 2 platform and is a recommended persistence mechanismfor data-centric applications on mobile devices.JDO can be used in the <strong>con</strong>text <strong>of</strong> a nonmanaged or a managedscenario. The former case refers to a typical two-tier orembedded application, the latter to a server-based architectureIlan Kirsh is a lecturer inComputer Science at theAcademic College <strong>of</strong>Tel-Aviv-Yaffo, and the author<strong>of</strong> ObjectDB (www.objectdb.com), a pure JDO objectdatabase for J2EE, J2SEand J2ME.kirsh@objectdb.comMark Cranshaw is a seniorlecturer in the Faculty <strong>of</strong>Technology at SouthamptonInstitute. He has extensiveexperience <strong>of</strong> deliveringeducation using Javatechnologies, including JDOtools. His current researchinterests include mobileJava and HCI.mark.cranshaw@solent.ac.ukwww.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200531


Featurewith the JDO implementation resident within a J2EE <strong>con</strong>tainer.In both cases the JDO implementation hides issues specific tothe Enterprise Information System (EIS), such as data type mapping,relationship mapping, and data retrieval and storage, fromthe application components. In addition, the managed scenarioallows the application to make use <strong>of</strong> J2EE <strong>con</strong>tainer mechanismsfor transactions, security, and <strong>con</strong>nection management.Clearly any JDO implementation within J2ME would be nonmanaged,though a distributed architecture that used JDO onmobile devices and also on a remote server would be possible.The rationale behind JDO is that an application needs to beextended only once to encompass the JDO architecture and willthen be able to access multiple and different EISs: object database<strong>sys</strong>tems, relational database <strong>sys</strong>tems, mainframe transactionprocessing <strong>sys</strong>tems, or ERP <strong>sys</strong>tems. The EIS vendor willbe able to create a single JDO implementation and in doing sowill allow pluggable access to any JDO-compliant application.The ability to run JDO in a MIDP <strong>con</strong>text depends on the ability<strong>of</strong> the JDO implementation to provide the services required bythe specification using only the resources available in a smalldevice.From the application perspective, the primary interface isPersistenceManager, supported by the Query and Transactioninterfaces. An object implementing this interface will be responsiblefor the management <strong>of</strong> the JDO instance life cycle. Thisincludes reading and writing from the data source and workingwith Query and Transaction objects to create the illusion thatthe entire network <strong>of</strong> objects reachable from the application,including persistent objects, are resident in memory at the sametime. Within a nonmanaged environment, a JDO applicationwill retrieve a PersistenceManager directly from a Persistence-ManagerFactory instance provided by the JDO implementation.Candidate persistent classes must implement the PersistenceCapableinterface, typically through the use <strong>of</strong> anenhancement tool provided as part <strong>of</strong> the JDO implementation.Enhancement is carried out after the domain modelis complete and is usually applied to the compiled bytecode, making this a completely transparent process. Thebinary compatibility <strong>of</strong> JDO instances means that they areportable between EISs without recompilation, provided aJDO implementation is available. It would not be realistic toexpect a mobile JDO implementation to include the developmenttools, such as the byte code enhancer, for JDO. Mobiledevices are unlikely to be used as s<strong>of</strong>tware developmentplatforms. Rather, the device would be required to act as aJDO client, downloading pre-enhanced byte code and usingthe JDO client APIs. However, it’s not enough for a JDO clientapplication to have only byte code, since any class that is tobe persisted must have a corresponding entry in an XML file,known as the persistence descriptor file. The developer maysupply a separate descriptor file for each class or a single filefor a package. This file, <strong>con</strong>taining key mapping information,must be available to the JDO implementation at runtime.Therefore, a MIDP JDO implementation would need to includeboth the JDO client APIs and the means to process thepersistence descriptor.smallest realistic JDO platform is currently a CDC <strong>con</strong>figurationusing a larger nonstandard library, such as the IBM JCL Maxavailable with the J9 VM. This kind <strong>of</strong> <strong>con</strong>figuration is appropriatefor Pocket PC type devices but not for mobile telephones.There are a number <strong>of</strong> reasons why implementing JDO ina CLDC/MIDP environment is problematical. The core issueis the required footprint size, because a JDO implementationwould require space for the implementation itself, plus thelarger byte code <strong>of</strong> classes enhanced to become persistent.Object data would have to be stored using RMS or a proprietaryJDBC implementation. Depending on the way that itmapped the objects, overall storage space requirements forJDO persistence would probably be larger than the most optimizedequivalent using direct RMS. Another problem wouldbe the speed <strong>of</strong> RMS, since it’s just a set <strong>of</strong> indexed flat filesthat require either direct indexed access or sequential accessto locate data. This could be very inefficient when attemptingto implement the JDO query language, JDOQL.As we’ve discussed, JDO also requires an XML persistencedescriptor that is accessible at runtime. A full validating parserto process this file would be much too large, but there arehighly optimized nonvalidating XML parsers designed for usewith J2ME, such as kXML or others that implement the XMLAPIs <strong>of</strong> the J2ME Web Services Specification. An alternativestrategy might be to use some other way <strong>of</strong> providingmetadata; for example, using the optional JAD (applicationdescriptor) or manifest files.Another limitation <strong>of</strong> the MIDP APIs is that they don’t includethe JDK 1.2 collections framework. This means that theonly <strong>con</strong>tainer classes available are the Vector and Hashtablefrom 1.x versions <strong>of</strong> Java, which is in<strong>con</strong>sistent with the JDOrequirements <strong>of</strong> at least supporting the HashSet. We coulddevelop some kind <strong>of</strong> wrapper class around the Vector to producea different type <strong>of</strong> <strong>con</strong>tainer that can be used in a J2ME<strong>con</strong>text, but this doesn’t address the further issue that Vectoris synchronized, which could impact performance. Anotheroption is to write a custom HashSet class (using an array <strong>of</strong>linked lists) and/or other custom library classes.To mitigate the potentially large footprint resulting from theproliferation <strong>of</strong> the additional classes necessary to make JDOfunction in a MIDP <strong>con</strong>text, a byte code shrinkage and/or obfuscationtool could be used. Since the main shrinkage benefitis gained where only small parts <strong>of</strong> libraries are used, the alreadysmall J2ME libraries would not necessarily yield a majorchange in footprint. For example, test results show only a 16%reduction in size for a sample J2ME application, as opposed toa best result <strong>of</strong> 91%.ApplicationJDO ImplementationJDBC DriverJVM / CLDC / MIDPData StoreImplementation Issues for JDO on MIDPCurrent JDO implementations cannot run on highly<strong>con</strong>strained devices using the J2ME CLDC <strong>con</strong>figuration. TheMobile DeviceFigure 2 Client JDO architecture for MIDPServer32 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


maintain quality <strong>of</strong> service (see Figure 5). Of course, this type <strong>of</strong> solution ismuch more complex, since it requires the JDO implementation to managethe distributed data that is being cached on mobile devices. We can expectthe development <strong>of</strong> <strong>sys</strong>tems using this kind <strong>of</strong> architecture to be supportedby implementations <strong>of</strong> the Java synchronization APIs.ConclusionThe current version <strong>of</strong> the MIDP specification is an interim set <strong>of</strong> APIsthat reflects a particular point in the development <strong>of</strong> mobile telephonetechnology. At present, mobile phone developers must work within the<strong>con</strong>straints <strong>of</strong> current devices and work around the <strong>con</strong>straints <strong>of</strong> the platformas best they can. Although the limited CLDC/MIDP libraries <strong>con</strong>strainmultiple aspects <strong>of</strong> Java application development, there are a number<strong>of</strong> initiatives in place to support applications migrating down to smallerdevices, including small footprint XML parsers and databases.Regarding JDO and whether or not it could be implemented to run on aMIDP device, our <strong>con</strong>clusion is that while MIDP alone cannot realisticallyhost a full JDO implementation, a distributed implementation that combineslocal processing with server support can indeed meet our applicationneeds. Not only that, but such an architecture actually opens up a morechallenging set <strong>of</strong> options for truly distributed <strong>sys</strong>tems that provide forwidely distributed data and processes.The real challenge for MIDP developers is to build applications that notonly work locally on a single device but can interact and synchronize withmultiple nodes <strong>of</strong> different types in a disparate architecture. In practice,running JDO on a single device provides few advantages over alternativeAPIs for data access. However, a distributed JDO implementation that integratedand synchronized data across multiple nodes, encapsulated behinda single distributed object model, could be a very valuable tool.From our discussion <strong>of</strong> JDO as an example <strong>of</strong> serious application development,we can see that developing s<strong>of</strong>tware for mobilized architecturesrequires us to <strong>con</strong>sider a range <strong>of</strong> aspects <strong>of</strong> design and implementation inorder to identify the optimum <strong>con</strong>figuration. MIDP alone cannot providea fully featured Java deployment platform. But, by playing to its strengths,such as the ability to maintain a persistent local data cache and supportit with server-side resources, it opens up a range <strong>of</strong> new opportunities ins<strong>of</strong>tware development.References• Kochnev, D., and Terekhov, A. “Surviving Java for mobiles.” IEEEPervasive Computing, Vol. 2, no.2, June 2003.• Sun Micro<strong>sys</strong>tems. (2003). “JSR-000185 Java Technology for theWireless Industry 1.0 (Final Release).” Java Community Process:http://jcp.org/aboutJava/communityprocess/final/jsr185/index.html• JDOCentral, Developer’s Community for Java Data Objects: www.JDOCentral.com• Reese, G. (2003). Java Database Best Practices. O’Reilly.• ProGuard Java Class File Shrinker and Obfuscator. Test results: http://proguard.sourceforge.net• Java Data Objects Expert Group, “JSR-000012 Java Data Objects 1.0.1(Maintenance Release), 2003, section 5.5.4.” Java Community Process:http://jcp.org/aboutJava/communityprocess/final/jsr012/index2.html• Dubé, J.; Sapir, R.; Purich, P.; and Siegal, E. “Oracle ApplicationServer TopLink - Application Developer’s Guide <strong>10</strong>g (9.0.4).” OracleTechnology Network, pp. 470–486, 2003: http://download-west.oracle.com/docs/cd/B<strong>10</strong>464_01/web.904/b<strong>10</strong>313.pdf• Braig A., and Gemkow, S. “The BonSai Principle – Persistenz in derJava 2 Micro Edition.” Java Spektrum. September 2002: www.sigs.de/publications/js/2002/09/Braig_JS_09_02.pdfFrom the Group Publisher–<strong>con</strong>tinued from page 3• Ken Iverson: Inventor <strong>of</strong> APL, later J• William Kahan: “The Old Man <strong>of</strong> Floating-Point”; primary architectbehind the IEEE 754 standard for floating-point computation• Robert Kahn: Co-inventor <strong>of</strong> the first Internetworking protocol, TCP• Mike Karels: System architect for 4.3BSD• Alan Kay: Inventor <strong>of</strong> SmallTalk• Gary Kildall: Author <strong>of</strong> the archetypical OS known as CP/M (<strong>con</strong>trolprogram for microcomputers)• Donald Knuth: “Father <strong>of</strong> Computer Science”; author <strong>of</strong> The Art <strong>of</strong>Computer Programming; inventor <strong>of</strong> TeX, allowing typesetting <strong>of</strong> textand mathematical formulas on a PC• Butler Lampson: Architect <strong>of</strong> Cedar/Mesa; implementer <strong>of</strong> Xerox Alto• Robert C. Martin: Agile s<strong>of</strong>tware development proponent; CEO, president,and founder <strong>of</strong> Object Mentor• Yukihiro Matsumoto (“Matz”): Creator <strong>of</strong> Ruby• John McCarthy: Creator, with his graduate students, <strong>of</strong> Lisp• Doug McIlroy: Head <strong>of</strong> department at Bell Labs where Unix started• Bob Metcalfe: Creator <strong>of</strong> Ethernet• Chuck Moore: Inventor <strong>of</strong> Forth, a high-level programming language• Andrew Morton: Linus’ No. 2 in the kernel group• Ted Nelson: Creator <strong>of</strong> the Xanadu project – universal, democratichypertext library; precursor to the WWW• Kristen Nygaard: Developer (with Ole-Johan Dahl) <strong>of</strong> SIMULA, thefirst object-oriented programming language• Peter Pag: Pioneer <strong>of</strong> 4GLS (1979); developed S<strong>of</strong>tware AG’s Natural• Bob Pasker: Founder <strong>of</strong> WebLogic, author <strong>of</strong> the first Java applicationserver• Benjamin Pierce: Harvard University faculty member for 49 years;recognized in his time as one <strong>of</strong> America’s leading mathematicians• P.J. Plauger: Chair <strong>of</strong> the ANSI C committee• Jon Postel: “The ‘North Star’ Who Defined the Internet”• John Postley: Developed Mark IV (1967), the first million dollar s<strong>of</strong>twareproduct, for Informatics• Martin Richards: Designer <strong>of</strong> the BCPL Cintcode System• Martin Roesch: Author <strong>of</strong> the open source program Snort, in 1998• Gurusamy Sarathy: Heavily involved in maintaining the mainstreamreleases <strong>of</strong> Perl for the past seven years• Carl Sassenrath: Author <strong>of</strong> REBOL, a scripting language• Guy L. Steele: Author <strong>of</strong> authoritative books and papers on Lisp• W. Richard Stevens: “Guru <strong>of</strong> the Unix Gurus”; author and <strong>con</strong>sultant• Ivan Sutherland: Considered by many to be the creator <strong>of</strong> ComputerGraphics• Avadis (Avie) Tevanian: Chief s<strong>of</strong>tware technology <strong>of</strong>ficer, Apple• Guy (Bud) Tribble: One <strong>of</strong> the industry’s top experts in s<strong>of</strong>twaredesign and object-oriented programming• Patrick Volkerding: Creator <strong>of</strong> Slackware Linux• John von Neumann: Pioneer <strong>of</strong> logical design; first computer theoristto tackle the problem <strong>of</strong> obtaining reliable answers from a machinewith unreliable components• Larry Wall: Author <strong>of</strong> Perl• John Warnock: Inventor <strong>of</strong> PostScript; CEO <strong>of</strong> Adobe Systems• Michael “Monty” Widenius: Creator <strong>of</strong> MySQL• Nicklaus Wirth: Inventor <strong>of</strong> Algol W, Pascal, Modula, Modula-2, andOberon• Stephen Wolfram: Scientist, creator <strong>of</strong> Mathematica• Jamie Zawinski: Instrumental in the creation <strong>of</strong> Lucid Emacs (nowXEmacs)www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200535


Core and Internals ViewpointCalvin AustinCore and Internals EditorJava InsideA co-editor <strong>of</strong> <strong>JDJ</strong> sinceJune 2004, Calvin Austinis the J2SE 5.0 SpecificationLead at Sun Micro<strong>sys</strong>tems.He has been with JavaS<strong>of</strong>tware since 1996 andis the Specification Leadfor JSR-176, which definesthe J2SE 5.0 (“Tiger”)release <strong>con</strong>tents.calvin.austin@<strong>sys</strong>-<strong>con</strong>.comIrecently upgraded my home networkto use 802.11g. The pricesfor routers and PC cards havefallen throughout the year, butunfortunately the support has onlymarginally improved in that time and,after many re-installs, my networkwasn’t working. I eventually had toresort to probing the card to find outthe exact chipset to get my Linux boxup and running. It’s fine now, but Ifound it ironic that probably the mostimportant part <strong>of</strong> the card that wouldensure compatibility was completelyhidden, both on the box and in all <strong>of</strong>the documentation.Things are a little different inembedded Java land. As a core Javadeveloper you’ve probably heard <strong>of</strong>J2ME and technologies like MIDP andyou could claim that the Java runtimeinside a J2EE application server is atleast hidden, if not embedded. Unlikemy network card, with phones andother devices it’s very clear whetherthey use Java technology and there’s avery good reason for that.I don’t get to spend that much timewith J2ME so I thought it would beuseful to share a quick primer onJ2ME technologies this month as a refresher.J2ME is a specification driventhrough the Java Community Process,just as J2EE and J2SE are specificationsfor the desktop and server platforms.As you would expect, devicestypically have a set <strong>of</strong> <strong>con</strong>straints.Some have become more flexible overthe last few years with improvementsto CPU speed and also to the amount<strong>of</strong> memory available; others such asscheduling and process prioritieshave remained core fundamentals.The most discussed technologies that“you may run into are CLDC, CDC,MIDP, and JTWI. The J2ME specificationitself replaced Personal Java,which was a one-size-fits-all editionfor small devices.CLDC, Connected Limited DeviceConfiguration, is a specification forvery small footprint <strong>sys</strong>tems. Connectedmeans that it can use Javanetworking APIs; limited refers to thefootprint or resources. The <strong>con</strong>figurationincludes only a very small set <strong>of</strong>classes and reduced JVM. The firstreference implementation that Sunreleased to adhere to that specificationwas called KVM. Adaptivecompiler hotspot JVMs are now availablefor CLDC. Most <strong>of</strong> the populardeployments <strong>of</strong> CLDC are combinedwith an additional set <strong>of</strong> librariescalled MIDP. The Mobile InformationDevice Pr<strong>of</strong>ile provides the user interfaceclasses, network management,security framework, media and gamesAPIs, and more. This combination <strong>of</strong>CLDC and MIDP is the technologyused in most Java-enabled phones.The CDC, Connected Device Configuration,follows the same naming<strong>con</strong>ventions as CLDC, but is for devicesthat can accommodate a largerfootprint. Still designed for machineswith as little as 2MB memory, this issignificantly larger than CLDC, whichscales down to 128KB. Again, there isa hotspot JVM implementation andthe larger footprint size means thatmore <strong>of</strong> the J2SE APIs are supported.CDC also requires the use <strong>of</strong> pr<strong>of</strong>ilesto deliver functionality, and with thepersonal pr<strong>of</strong>ile you can supportbasic applets.I’ve only mentioned a few pr<strong>of</strong>ilesand have not even begun to dis-cuss the optional packages that areavailable. Due to the rapid growth<strong>of</strong> packages and to ensure a basiclevel <strong>of</strong> functionality that extends beyondCLDC/MIDP, the Java Technologyfor the Wireless Industry (JWTI)specification was created. This inmany ways is like a platform specificationbut defines the core level <strong>of</strong>functionality for devices that are JTWIcompliant.At this point you may be thinkingwhat can I do with those <strong>con</strong>figurations?They look like they’re for devicemakers, not regular developers. Thatis partly correct, but you need aCDC or CLDC reference <strong>con</strong>figurationto be able to run your wirelessor embedded applications, andimplementations <strong>of</strong> CDC and CLDCare available for running outside <strong>of</strong>a device on a regular PC. If you areinterested in writing J2ME programs,the Java Wireless Toolkit is the placeto start. This environment <strong>con</strong>tainsthe core APIs you need to make yourown phone application and to takeadvantage <strong>of</strong> the media APIs, wirelessmessaging, and the latest Bluetoothtechnology.Sometimes knowing what’s insidedoes make a difference. I would recommendgiving the wireless toolkit atry; perhaps you have the next killerphone app in your reach!Finally I wanted to mention one <strong>of</strong>the new developments in J2SE. Boththe J2SE 5.0 source and now weeklybinaries and source from J2SE 6.0 areavailable from http://java.sun.com.The J2SE 6.0 development is still in itsearly stages so if you are expecting tosee big changes there, you’ll need towait a little while.Due to the rapid growth <strong>of</strong> packages and to ensure a basic level <strong>of</strong>functionality that extends beyond CLDC/MIDP, the JWTI specification was created”36 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


FeatureTRANSLATION-BASEDINTEGRATIONby Alexander KrapfRocky road made smoothAlexander Krapf is presidentand c<strong>of</strong>ounder <strong>of</strong> CodeMesh,Inc. Krapf has over 15 years<strong>of</strong> experience in s<strong>of</strong>twareengineering, productdevelopment, and projectmanagement in the UnitedStates and Europe. He hasbeen extensively involved in avariety <strong>of</strong> complex productdevelopment efforts, using hisin-depth understanding<strong>of</strong> .NET, C++, and Java.Alexander has been publishedin technology journals and hasbeen a speaker at a variety<strong>of</strong> industry <strong>con</strong>ferences.He received a bachelor <strong>of</strong>science degree in electricalengineering from theUniversity <strong>of</strong> Stuttgart,Germany.alex@codemesh.comAnyone who regularly works with more than onedevelopment language and a third-party library has facedthe situation described by: “Great library, if only I couldhave it in my programming language.” Some vendors makea living from publishing different language versions <strong>of</strong> theirproduct, but many can’t afford or don’t want to pay the costs <strong>of</strong>maintaining several parallel implementations <strong>of</strong> their product.Consequently, over the years many integrationapproaches have been created to help us withthe common problem <strong>of</strong> using s<strong>of</strong>tware writtenin one language in another language. Micros<strong>of</strong>t haseven gone as far as building language inter-operabilityinto the core <strong>of</strong> its .NET platform (<strong>of</strong> course, theyexcluded Java). When talking about .NET, it should also bementioned that a .NET-compatible language has to satisfymany <strong>con</strong>straints imposed by the .NET platform. So many<strong>con</strong>straints, in fact, that some people have said you don’treally write your code in C++ or VB, but rather in a particulardialect <strong>of</strong> .NET. For anybody who is not using .NET,or who has to integrate .NET with .NET-foreign languagessuch as Java, here are the basic integration approaches:1. Source code translation: Translate the Java source code<strong>of</strong> a library to C++.2. Byte code/binary code translation: Take a compiled Javaclass file and compile it into object code. This, as well asthe previous approach, can also be referred to as “implementationtranslation,” because the method bodies are<strong>con</strong>verted.3. In-process wrapping: Create a C++ wrapper for a Javatype that internally uses JNI to delegate from C++ toJava.4. Out-<strong>of</strong>-process wrapping (remoting): Make a Java typeavailable to a C++ programmer by calling from the C++application into a Java process via sockets. This, as wellas the previous approach, can also be referred to as“interface translation,” because only the API signaturesare <strong>con</strong>verted.5. RPC/Web services/messaging: This is really a special case <strong>of</strong>(4) and involves the sending <strong>of</strong> messages between applicationswritten in different languages. SOAP, CORBA, XMLRPC, etc., are examples <strong>of</strong> this integration approach.All <strong>of</strong> these different integration approaches have one thingin common – to work for a reasonably large code library or API,an automated translation/transformation engine is an absolutemust. Imagine having to translate the Java runtime libraryto C++ by hand or having to hand-assemble and dispatch aSOAP request in a C++ program just to call a Java method.Also, let’s not forget that this type <strong>of</strong> integration problemdoes not start out with a portable interface description likeCORBA’s IDL or Web services’ WSDL, but rather with a full, preexistingimplementation in one <strong>of</strong> many possible technologies.Let’s take a quick look at some factors that influenceour choice <strong>of</strong> integration technology before we delve intothe more technical aspects. I haven’t listed these points byimportance; which points are important to you dependsentirely on your specific integration project.GranularityAt what level do we integrate? If we are dealing with acomponent API, i.e., an API that has relatively few integrationpoints for relatively hefty operations, an RPC-basedintegration could be a good fit.PerformanceIf we need fine-grained integration at the API level, anyRPC-based solution is usually ruled out because we cross thelanguage boundary too <strong>of</strong>ten for too little work, resulting inbad performance.ReliabilityAny out-<strong>of</strong>-process/RPC solution introduces new failuremodes into an overall solution. Can you create a reliable integrationsolution for the specific API that you wish to use? If theanswer is yes, how much more complicated is it going to be?SecurityIs an out-<strong>of</strong>-process/RPC solution without additional securitymechanisms acceptable for your integration problem?Is additional security available and how much is it going tocomplicate the project or increase the price?38 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


ScalabilityIn-process integration solutions usually have the best performanceby far, but they may be wasteful in terms <strong>of</strong> <strong>sys</strong>temresources, and scalability might benefit from being able to distributeintegration components. On the other hand, some APIscannot be distributed/remoted without jeopardizing reliability.FidelityHow true to the original should the integration APIbe? Should it be self-evident to a user <strong>of</strong> the original APIor are some special skills (like JNI, CORBA, or SOAP) required?PurityIs it necessary to completely remove the original technologyfrom the picture (i.e., by translating/porting the code) or canwe bridge between the two sides? Bridging might be the onlyfeasible solution if you don’t have access to all the referencedpieces (for example, a source code translator does not work ifthe code that needs to be translated references a third-partylibrary for which you don’t have the source code).LicensingThis is <strong>of</strong>ten an issue for translation-based tools: evenif you can translate your own code for an integrationsolution, do you have the necessary rights to translatereferenced source code (for example, from a J2SE sourcedistribution)?MaintenanceIs your integration solution tied to a specific version<strong>of</strong> a technology and how easy is it to regenerate the integrationsolution and upgrade to a new version <strong>of</strong> the technology?Clearly, given an API in one language, we would loveto have the following: an automatically generated, highlyreliable, totally secure, highly performing, true-to-theoriginal,semantically equivalent API in the other language.World peace would be another nice thing to have, whilewe’re at it.In the real world, <strong>of</strong> course, things are not that simple.I always like using Java and C++ as an example – first, becauseI know a lot about these two languages and, se<strong>con</strong>d,because they are deceptively similar. Many people thinkthat it should be simple to translate an application writtenin one language into the other language. Let’s take a closerlook at this. The Java class in the following code will be ourfirst example.this type with a JavaSpace or we might simply have made itpublic due to a design oversight.Now let’s cook up a C++ class that does the same thing. Thatshould be easy, shouldn’t it? We could probably write a simpleparser and translator and come up with the automaticallygenerated C++ type in the following.class Person{public:std::string name;Person() : name() {}Person( <strong>con</strong>st Person & p ) : name( p.name ) {}~Person() {}std::string getName() { return name; }void setName( std::string n ) { name = n }static void delete( Person & p ){PersonUtil::delete( p.name );}static Person create( std::string n ){return Person( n );}};That’s a straightforward look-alike <strong>of</strong> the original Javatype in C++. We’ll have at least one immediately obviousproblem here: delete is a reserved word in C++, so thegenerated code won’t compile. In the case <strong>of</strong> delete this isan easily solved problem; we simply use _delete or somepublic class Person{public String name;public Person() { name = null; }public Person( Person p ) { name = p.name; }public String getName() { return name; }public void setName( String n ) { name = n; }public static void delete( Person p ) { PersonUtil.delete(p.name );public static Person create( String n ) { return new Person( n); }}This is a fairly straightforward Java class. The only slightlyunusual thing about it is its public data member called name.Maybe we were forced to make it public because we’re usingwww.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200539


Featureother mangled form <strong>of</strong> the reserved word. The ease <strong>of</strong> solvingthis problem hides a deeper problem though: C++ has apreprocessor that usually predefines many macros. Each <strong>of</strong>those macros really has to be treated like a reserved word,and that is going to be complicated without a sophisticatedtool.Then there is a host <strong>of</strong> less obvious problems with thisnaïve translation. Let’s go through them one by one.1. We translated the Java Person( Person ) <strong>con</strong>structor intothe C++ copy <strong>con</strong>structor. This is totally appropriatebased on its call signature, but it might not be appropriatesemantically. The C++ copy <strong>con</strong>structor is invokedautomatically by the compiler in many scenarios, whereasthe original Java <strong>con</strong>structor is only supposed to beinvoked explicitly by the programmer. Will our generatedcode have the correct semantics? It depends on the type,which is usually not a satisfactory answer.2. In Java, we had a string field; in C++ we have a correspondingstd::string field. There’s another semanticdifference hidden in this seemingly obvious translation:String instances are immutable, whereas std::stringinstances can be modified. Yes, we could try working with<strong>con</strong>st or mutable modifiers, but those modifiers mightcollide with other intended semantic usages.3. The create method in the Java class returns a new Personinstance. We’re facing the question <strong>of</strong> what to returnfrom the corresponding C++ method. If we return thePerson instance by value as in the sample code, we makesure that it does not get created on the heap and that wedon’t have a memory leak if we ignore the return value(something that’s usually safe to do in garbage collectingJava). The downside <strong>of</strong> this approach is that we endup with an instance <strong>of</strong> class Person. We can now neverreturn a subtype <strong>of</strong> Person from this method unless wereturn the result through a pointer to Person or a referenceto Person. But if we return the result via a pointer,we put the burden <strong>of</strong> freeing the instance on the caller,which is a built-in memory leak as the return value isusually ignored on the Java side. This demonstrates howa perfectly correct and proper translation can yield eithersemantically incorrect or semantically hard-to-use code.It’s a true catch 22.4. In the delete method, we’re calling into the PersonUtiltype. This means we have to translate this as well, ormake it available in some other fashion in order for theintegration project to be a success. In a typical integrationproject, you quickly face a type explosion due tothese dependencies. For example, if you analyze the Javatype object, you find out that it references (directly orindirectly) between 250 and 350 types. A good translation-basedintegration tool will allow you to prune downthe type set to just the types that you’re interested inwithout compromising usability.Other big semantic issues in a Java/C++ translation involve:• Inheritance semantics (is inheritance allowed or not)• Exception semantics (C++ exception declarationshave very different semantics from Java exceptiondeclarations)• Interface semantics• Life cycle management and copy semantics• Thread semanticsJust translating a Java statement to a correspondingC++ statement rarely does the job. The problem is mostlynot the syntax differences between the two languages butrather the semantic differences between the languages.Also think about the work that might be required to replacethe platform infrastructure like the String class. In Java,String has a lot <strong>of</strong> functionality; how much depends onwhich version <strong>of</strong> String you’re looking at. If we simplytranslate String to std::string, what’s going to happen to theoriginal Java functionality <strong>of</strong> String?The point I’m trying to make is that naïve translationsvery quickly run into lots <strong>of</strong> problems unless the translatedAPI is very small. Where does this leave us? It leaves us withtwo basic options.1. Put the semantic integration burden on the userThis is the path that most EAI strategies like Web servicesor CORBA take. The user creates what amounts to an integrationmodel (IDL, WSDL) and implements it in terms <strong>of</strong>his or her favorite technology.Some tools can help by generating integrationmodels based on existing code, but, as I already pointedout, this is a tricky proposition because somesemantic usability (extensibility, life-cycle, etc.) cannotbe expressed in your integration model <strong>of</strong> choice. Alsoas already mentioned, this approach works best forcomponent models with relatively few and relativelysimple entry points. Simple means that you don’t havemany complex, user-defined or platform types, but ratherprimitive types or pseudo-primitive types, like String orDate.2. Put the semantic integration burden on the translationtoolThis is the path that is taken by some integration solutionsthat are exclusively targeting language-integrationproblems. These tools create very sophisticated type modelsthat mirror (to the extent possible) the underlying typemodel.The developer can use arbitrarily complex user- orplatform-defined types as if they were written in his or herlanguage.In my opinion, the latter alternative is the better one becauseit avoids the pitfalls <strong>of</strong> having to <strong>con</strong>stantly maintainan integration model and because the “unexpected” APIdifferences are small. The more a developer has to learnwhen using a type that is written in a different language,the less successful the integration technology is going to be.Any special knowledge that is required creates “friction,”and friction causes bugs, and bugs cost money and causethe tool to be unpopular.I believe that the automated translation <strong>of</strong> code (sourceor object) into another language, be it an implementationtranslation or a calling interface translation, is the way to g<strong>of</strong>or language integration.40 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


Desktop Java ViewpointJoe WinchesterDesktop Java EditorThe Return <strong>of</strong> the PigJoe Winchester is as<strong>of</strong>tware developerworking on WebSpheredevelopment tools forIBM in Hursley, UK.joewinchester@<strong>sys</strong>-<strong>con</strong>.comThe key to building a distributedapplication successfully lies in asensible partition <strong>of</strong> work acrossthe different boundaries anddevices. With a client/server program,one <strong>of</strong> the advantages it <strong>of</strong>fers over amore traditional thin client is that foreach task, instead <strong>of</strong> having to wait forthe server to page the application backinto memory, process the results <strong>of</strong> thedisplay buffer, and prepare output, thePC is able to <strong>of</strong>fload some <strong>of</strong> the validationand processing locally.Not only is this more responsive tothe user, but it makes sense to have aphysical division <strong>of</strong> responsibilities inwhich code logic is executed closest towhere relevant resources lie. Field-levelvalidation, defaulting, and completion<strong>of</strong> values can all be done on the client.Even where such processing requirestrips to the server, an atomic call to theserver on a text field’s focus-changeevent can easily validate an entry againsta database. By scheduling the displaythread this way the GUI can remainresponsive. Another benefit <strong>of</strong> using theclient’s windowing sub<strong>sys</strong>tem fully is theability to open multiple shells or dialogssimultaneously and have the user move,size, and arrange them to make the bestuse <strong>of</strong> the available space.In a presentation to users or a salespitch to potential customers, the eyecandy<strong>of</strong> a windows program will alwayswin over a terminal-based application.In chapter one <strong>of</strong> the client/serverwars, those with a lot <strong>of</strong> investmentin back-end technology required aquick fix to counter the glitterati <strong>of</strong> theGUI, and one technique that arose is“screen scraping.” This is where thedata stream intended for the server’sterminal is interpreted and re-presentedon the desktop using a best guess set<strong>of</strong> <strong>con</strong>trols and widgets. From the back<strong>of</strong> a dimmed room in a demo or onthe noisy floor <strong>of</strong> a s<strong>of</strong>tware booth at a<strong>con</strong>ference, it looks pretty impressive.It’s no more than a fool’s shiny silverbullet, however, as all that it gains is theglitter <strong>of</strong> the GUI without any accompanyingdepth. The transactional mode<strong>of</strong> the application remains with logicbeing done on the server; simultaneousmultiple windows don’t occur as theworkflow is restricted to merely coloringin the terminal’s display, and an extralayer <strong>of</strong> processing has been added tothe previously working program for verylittle perceived benefit.One metaphor <strong>of</strong>ten used to describescreen scraping is “lipstick on a pig,”perhaps loaded slightly unfairly with theimplication being that the original applicationshares its characteristics with asnorting, mud-loving suidae beast. Whatis correct with the analogy is that skindeepcosmetics don’t change the truemakeup <strong>of</strong> the underlying subject.Screen scraping fortunately hasn’ttaken root in serious application development,instead the Web browser hasbecome the modern terminal; HTML,the display format; and users have beendelivered the graphical interface theyyearned for. While true client/serverdevelopers were wrestling, solving issuessuch as <strong>sys</strong>tems management anddistribution in a heterogeneous world,the Web filled in the s<strong>of</strong>tware spacecreated by the growth in the PC marketand the availability <strong>of</strong> faster and cheapernetworks.Web applications still suffer fromsome <strong>of</strong> the problems that any pagebasedserver GUI has, including thetransactional nature <strong>of</strong> the screens,round-tripping for validation not deliveringa highly responsible application,and the difficulty <strong>of</strong> working with multiplewindows simultaneously. Most <strong>of</strong>the problems that plagued client/serverdevelopment have been solved and severalcustomers I talked to are reassessingthe desktop because their applicationshave reached the physical boundaries<strong>of</strong> what a traditional J2EE program candeliver. There are more tools availablenow such as Java Web Start, better Swinglibraries, and the Eclipse Rich ClientPlatform.History has a habit <strong>of</strong> repeating itself,and in the past few months I’ve beenalarmed to see demos <strong>of</strong> and read aboutseveral new ways to create a “rich desktopapplication” from within J2EE. All <strong>of</strong> theseeloquently outline the current problemsand limitations <strong>of</strong> the Web programmingmodel from a user standpoint and preachthe advantages <strong>of</strong> maximizing the power<strong>of</strong> the desktop. What is disturbing is thata lot <strong>of</strong> these then present a solutionthat is no more than 21st century screenscraping. Some <strong>of</strong> these <strong>of</strong>fer solutions inwhich the same presentation markup canbe rendered in a browser as a portlet orelse in a desktop engine as the same GUI,but with native <strong>con</strong>trols.The debated advantages to this arethat the investment in existing technologyis preserved, and the same programcan be deployed into a browser or tothe user’s desktop with the flick <strong>of</strong> aswitch. My fear regarding these kinds<strong>of</strong> programs is that on the desktopthey won’t look and feel and behaveas a true client program should, andbecause they falsely use adjectives suchas “rich” or “desktop” to describe them,they’ll somehow dilute these terms andmake it hard for users to distinguish adressed-up Web application from a trueclient one.One <strong>of</strong> the advantages <strong>of</strong> having thebrowser shell is that every thing thatlies within it is expected to operate ina certain way, and requests to the userto “press retry to refresh the page” ornotifications that a “session time-outoccurred” have become acceptable. Disguisingthe browser with native <strong>con</strong>trolsbut not <strong>of</strong>fering any <strong>of</strong> the advantages <strong>of</strong>a properly <strong>con</strong>structed client program <strong>of</strong>fersa thin veneer that is no different fromthe screen scraping techniques <strong>of</strong> yore.When the same server program cankick out a browser and rich GUI, is thisan elegant solution that is going to meetthe user’s requirements, or is it justsomething that is technically elegantand demos well, but behind the robes isno more than lipstick on a browser?42 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


Java TipsA Time Zone PatchA flexible solutionby Paulo CaroliPaulo Caroli, www.caroli.org,is the J2EE architect at blah!, aTelecom Italia Mobile (TIM)value-added services provider.Paulo has a master’s degree ins<strong>of</strong>tware engineering and is aSun Certified Architect for JavaTechnology, with expertise inhigh-performance enterpriseapplication development.pcaroli@corp.blah.comThe java.util.TimeZone abstract classthat represents a time zone is usedto produce local time for a particularglobal time zone. A TimeZonecomprises three basic pieces <strong>of</strong> information:an ID, a time zone <strong>of</strong>fset, and thelogic necessary to deal with DST (DaylightSavings Time).While working with the TimeZone classprovided with JRE 1.3 and 1.4, however, Idiscovered that it provides erroneous timesfor several time zones. This article describesthis DST transition date problem, presentsTimeZone test scenarios, and introducesTimeZonePatch. This patch is a flexible solutionthat enables the java.util.TimeZoneto produce correct time zone data.TimeZone ProblemI encountered the problem whileworking in a Java application that deliversShort Message Service (SMS) to wirelessdevices. The company’s SMS applicationwas being used in several countriesand users were registering from severaldistinct time zones. A key requirement forthe application is to have the user’s localtime as part <strong>of</strong> the SMS message.The TimeZone JRE class was being usedto retrieve the user’s local time in the SMSmessage according to the user’s registeredtime zone. It was discovered, however,that the application was delivering erroneouslocal times, and further investigationshowed that the DST transition dateswere not accurate for a number <strong>of</strong> timezones.Testing TimeZoneThe following test case was used toidentify the time zone DST transition datesproblem. It’s based on the JUnit frameworkand is composed by TestTimeZone andDST classes (see Listings 1 and 2, respectively).The source code can be downloadedfrom www.caroli.org.The correct DST entry and exit datescan be selected from trusted sources. Forthis article the dates were selected from theworld clock Web site: www.timeanddate.com/worldclock/full.html.To verify the DST transition problemthe TestTimeZone test case was executedfor two distinct time zones: America/Sao_Paulo and America/Santiago. The timezone data in the DST classes was retrievedfrom the world clock Web site.The testsresults are depicted in Figures 1 and 2.Note that these tests are based on the JDKTimeZone class usage.TimeZone Test 1:America/Santiago time zonepublic class DST{public static final String DATE_FORMAT ="MM/dd/yyyy";public static final String START_DST ="<strong>10</strong>/<strong>10</strong>/2004";public static final String END_DST ="03/14/2004";public static final String TIMEZONE_LOCATION = "America/Santiago";}TimeZone Test 2:America/Sao_Paulo time zonepublic class DST{public static final String DATE_FORMAT ="MM/dd/yyyy";public static final String START_DST ="11/02/2004";public static final String END_DST ="02/15/2005";public static final String TIMEZONE_LOCATION = "America/Sao_Paulo";}Test 2 for TimeZone shows the inaccuracyin the DST entry date <strong>of</strong> the TimeZoneclass with the America/Sao_Paulo timezone.Patching TimeZoneThe tests were executed with JRE 1.3 and1.4 and both showed the same problem.Both versions <strong>of</strong> the TimeZone class readtime zone IDs from the the tzmappingsfile in the jre/lib subdirectory. JRE 1.4 also<strong>con</strong>tains time zone data files for variousworld regions in the jre/lib/zi subdirectory.One solution for the 1.4 TimeZone classis to update the time zone files; however,these are binary and its change is dependenton you having access to and intimateknowledge <strong>of</strong> the JRE. The JRE providercould supply updates to the time zone files,however, it’s not straightforward even forthem to keep track <strong>of</strong> all the time zones’correct data. Although there are <strong>con</strong>ventionsabout the DST transition dates andtimes, countries have the freedom to decidetheir own transition dates and times,and this has occurred in several places.For these reasons I developed a patch forthe SDK TimeZone, which solves the wrongDST transition dates problem independent<strong>of</strong> the original TimeZone implementation.TimeZone Test Set-Uppublic class TestTimeZone extends TestCase {.protected void setUp() throws Exception{// timeZone = TimeZonePatch.getTimeZone(DST.TIMEZONE_LOCATION);timeZone = TimeZone.getTimeZone(DST.TIMEZONE_LOCATION);super.setUp();}.}TimeZonePatchThe TimeZonePatch class has been createdfor patching time zones according toan elected time zone data source. Listing 3shows the TimeZonePatch code.The fix works by having the TimeZone-Patch class return your desired version<strong>of</strong> TimeZone. In case there is a time zonecorrection, this correction will be set inthe timezonePatchList, which holdsthe patched TimeZone’s objects. TheTimeZonePatchListFactory class buildstimezonePatchList.A Factory <strong>of</strong> Your Time Zone DataTimeZonePatchListFactory can get thetime zone data from different sources. Forexample, the time zone data source can bean XML file, text file, database, Web service,or any other data source appropriate foryour application.Listing 4 shows TimeZonePatchListFactory,a Factory Method implementationthat creates a time zone patch list based onan XML time zone data source. (Listings4–6 can be downloaded from www.<strong>sys</strong><strong>con</strong>.com/java/sourcec.cfm.)Listing 5 has timezonePatch.xml, anXML data source read by TimeZonePatch-ListFactory for patching the America/Sao_Paulo time zone.44 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


The presented TimeZonePatchListFactory implementationuses JOX (Java Objects in XML) library for reading the XMLfile into the TimeZonePatchList JavaBean.When reading the XML document, a mapping betweenthe root node name – TimezonePatchList – and the nestednodes – timezonePatch, dst, startDate, and endDate – isautomatically made for the TimeZonePatchList bean,and the nested beans – TimeZonePatch, DST, and Date –respectively.Figure 1 TimeZone Test 1 (America/Santiago DST transition) resultTesting TimeZonePatchTimeZonePatch has also been tested by the same TestTimeZone testscenarios.TimeZonePatch Test Set-Uppublic class TestTimeZone extends TestCase {.protected void setUp() throws Exception {timeZone = TimeZonePatch.getTimeZone(DST.TIMEZONE_LOCATION);// timeZone = TimeZone.getTimeZone(DST.TIMEZONE_LOCATION);super.setUp();}.}Figure 2 TimeZone Test 2 (America_/Sao_Paulo DST transition) resultFigure 3 TimeZonePatch Test 1 (America/Santiago DST transition) resultThe two distinct time zones, America/Sao_Paulo and America/Santiago, were retested, but now with the test class using Time-ZonePath instead <strong>of</strong> the SDK TimeZone.TimeZonePatch Test 1:America/Santiago time zonepublic class DST{public static final String DATE_FORMAT = "MM/dd/yyyy";public static final String START_DST = "<strong>10</strong>/<strong>10</strong>/2004";public static final String END_DST = "03/14/2004";public static final String TIMEZONE_LOCATION = "America/Santiago";}Figure 4 TimeZonePatch Test 2 (America/Sao_Paulo DST transition) resultTimeZonePatch Test 2:America/Sao_Paulo time zonepublic class DST{public static final String DATE_FORMAT = "MM/dd/yyyy";public static final String START_DST = "<strong>10</strong>/17/2004";public static final String END_DST = "02/15/2005";public static final String TIMEZONE_LOCATION = "America/Sao_Paulo";}As depicted in TimeZonePatch test 1 and 2 (see Figures 3 and 4),the presented TimeZonePatch solution works properly for both timezones, proving to fix (according to the provided data source) theincorrect DST transition dates occurring in the SDK TimeZone classfor the America/Sao_Paulo time zone (the identified incorrect Time-Zone).ConclusionThe TimeZonePatch presented in this article provides a flexiblesolution for patching the java.util TimeZone against incorrect timezone data. A factory <strong>of</strong> TimeZone patches, TimeZonePatchList-Factory, provides the ability to read correct time zone data fromappropriate data sources or even create new time zones. Furthermorethe presented solution patches only the time zones createdby the factory, although it still works for the remaining SDK timezones.www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>January 200545


Java TipsReferences• JUnit framework: www.junit.org• The source code for this article:www.geocities.com/paulocaroli/src/timezonePatchCode.zip• The world clock Web site: www.timeanddate.com/worldclock/full.html• Gamma, E.; Helm, R.; Johnson,R.E.; and Vlissides, J. (1995). DesignPatterns: Elements <strong>of</strong> ReusableObject-Oriented S<strong>of</strong>tware. Addison-Wesley.• JOX (Java Objects in XML): www.wutka.com/jox.html• JOX download: www.wutka.com/joxdownload.html• DTDParser download: www.wutka.com/dtdparserdownload.html• Xerces-J download: http://xml.apache.org/dist/xerces-j/Xerces-Jbin.1.4.4.zip• Caroli, P. “Java Tip 138: Still parsingto generate your JavaBeans’ XMLrepresentation?” JavaWorld, 2003:www.javaworld.com/javatips/jwjavatip138_p.htmlListing 1: TestTimeZone.javapackage timezonePatch.test;import junit.framework.*;import java.util.Date;import java.util.Calendar;import java.util.TimeZone;import timezonePatch.TimeZonePatch;import java.text.SimpleDateFormat;public class TestTimeZone extends TestCase {private TimeZone timeZone;public TestTimeZone(String name) {super(name);}protected void setUp() throws Exception {// timeZone = TimeZonePatch.getTimeZone(DST.TIMEZONE_LOCATION);timeZone = TimeZone.getTimeZone(DST.TIMEZONE_LOCATION);super.setUp();}private boolean entryDST(TimeZone timezone, String entryDate,String dateFormat) throws Exception {Date startDST = this.stringToDate(entryDate,dateFormat);//one day after DSTboolean oneDayAfterExitDSTDate = timezone.inDaylightTime(this.dayAfter(startDST));// one day before DSTboolean oneDayBeforeEntryDSTDate = timezone.inDaylightTime(this.previousDay(startDST));// correct values:// oneDayBeforeEntryDSTDate == false &&// oneDayAfterExitDSTDate == truereturn (!(oneDayBeforeEntryDSTDate) && (oneDayAfterExitD-STDate));}private boolean exitDST(TimeZone timezone, String exitDate,String dateFormat) throws Exception {Date endDST = this.stringToDate(exitDate,dateFormat);//one day after DSTboolean oneDayAfterExitDSTDate = timezone.inDaylightTime(this.dayAfter(endDST));// one day before DSTboolean oneDayBeforeExitDSTDate = timezone.inDaylightTime(this.previousDay(endDST));// correct values:// oneDayBeforeExitDSTDate == true &&// oneDayAfterExitDSTDate == falsereturn ((oneDayBeforeExitDSTDate) && !(oneDayAfterExitD-STDate));}public void testValidTimeZone() throws Exception {boolean expectedReturn = true;String[] allTimeZoneIds = timeZone.getAvailableIDs();boolean foundTimezone = false;for (int i=0; i


The Most Important Technology Event <strong>of</strong> the Year!March 14-16, 2005 Ernest N. Morial Convention Center New Orleans, LA www.ctia.orgREGISTER BEFOREJANUARY 31, 2005andSaveup to$345!CTIA’s12 th AnnualWirelessGalaThe wirelessindustry’s premierenetworking eventis always thehottest ticketin town!For sponsorshipinformation <strong>con</strong>tactBonnie Knight atbknight@ctia.org.Daniel A. CarpChairman and ChiefExecutive OfficerEastman Kodak CompanyJeong Han KimPresidentSamsungTelecommunicationsAmericaSteve LargentPresident/CEOCTIA-The WirelessAssociationKeynotesStay tuned for more exciting Keynote announcements...CTIA WIRELESS 2005is the most important global eventwhere standards bodies <strong>con</strong>verge toset the agenda for the future <strong>of</strong> the wirelessindustry. Network with the largestgathering <strong>of</strong> wireless engineers andtechnologists to find the tools you needto help advance the wireless industry.CTIA WIRELESS 2005 <strong>of</strong>fers numerousopportunities for the wireless engineerand technologist: CTIA Education – a track dedicated towireless technology Tower Summit & Trade Show 2005 –premiere wireless infrastructure event IEEE Wireless Communications NetworkConference (WCNC) 2005 – the industry’sforemost <strong>con</strong>ference for developing wirelessstandards and engineering Developers Conferences Exhibits – a 400,000 sq. ft. floor displayingthe latest in wireless technology Wireless News – More new wireless productannouncements than any other show! CTIA Wireless Home – a 7,000 sq. ft. homethat brings wireless technology to lifeProduced by


LabsJBuilder 2005by Borland S<strong>of</strong>tware CorporationReviewed byKen SipeKen Sipe is the CEO andfounder <strong>of</strong> Code Mentor, Inc.He provides coding, mentoring,and training in OOAD andJava technologies. In addition,Ken is an internationallyrecognized speaker in the field<strong>of</strong> distributed computing,speaking <strong>of</strong>ten at JavaOne,NFJS, and BorCon.kensipe@codementor.netThere is an old joke in whicha man is seen coming from a<strong>con</strong>servation area with a heftycatch <strong>of</strong> fish. After noticing thepr<strong>of</strong>iciency <strong>of</strong> the fisherman whenothers had come back empty-handed,a park ranger decides to tag alongwith him. When they get to a specificlocation, the fisherman lights a stick<strong>of</strong> dynamite and throws it in the water,retrieving a huge quantity <strong>of</strong> fish.While the ranger begins to explainthe illegal nature <strong>of</strong> the fisherman’sactions, the man lights another stick,hands it to the ranger, and says, “Doyou want to talk?…or do you want t<strong>of</strong>ish?” Borland, with JBuilder, seems toask a similar question, “Do you wantto play, arrange, and mess with yourdevelopment environment?…or doyou want to code?”It isn’t possible to provide anin-depth review <strong>of</strong> all <strong>of</strong> JBuilder’sfeatures in this short article. Whilepreparing to write this review, I downloadedJBuilder 2005’s feature matrixand found it was 32 pages! This articlereviews JBuilder 2005 Enterprise Edition,which was released to the publicAugust 2004. However, since I was inthe group <strong>of</strong> beta testers, I had usedJBuilder 2005 for several months priorto its public release.Editor FeaturesSignificant improvements can befound in the editor. MemberInsighthas been updated to become SmartMemberInsight. Instead <strong>of</strong> the dropdowndisplaying all methods for agiven object, it’s filtered to the mostlikely candidates. This can be very <strong>con</strong>fusingat first and takes some gettinguse to. Depressing ctl+h will expandthe filtered list to all possibilities. Keymappings can be adjusted to providethe previous behavior.ErrorInsight is fairly new in JBuilderand provides a welcomed approachto agile development. Essentially, anyerrors written in code will be highlightedby ErrorInsight flags. Alt+enterinvokes the ErrorInsight to provideoptions; for example, when used witha TDD approach, referencing classesthat don’t exist yet causes JBuilder toask if it should search for the referenceor create a new class. Similarly,if a method is used that throws anexception, the provided options (dependingon code location) are “AddThrows Clause,” “Add Catch Clause,”and “Surround with Try/Catch” (seeFigure 1).Development help can also begleaned from code audit. This newfeature highlights potential <strong>con</strong>cerns.For instance, a comparison <strong>of</strong> twostrings with the “==” operator is usuallya mistake. With code audits, thiscode is highlighted with a description<strong>of</strong> the issue. This feature can get annoyingdepending on code style. Forinstance, it complains that code afteran if statement needs to be in a codebody. Each <strong>of</strong> these audits can be <strong>con</strong>figuredon a project-by-project basis,but again illustrates another deficiency:there doesn’t appear to be a way toexport and import preferred audit listsfor a department so it can be used inanother project. Hopefully this will beextended in the future to work like ErrorInsight.If the tool knows that codeaudit’s preference is to put code in acode block after an if statement, whydoesn’t it assist with that? This is stilla welcome feature though as manyFigure 1 ErrorInsight exampleBorland S<strong>of</strong>tware Corporation<strong>10</strong>0 Enterprise WayScotts Valley, CA 95066-3249Phone: 800 632-2864E-mail: customer_service@borland.comWeb: www.borland.comSpecifications PlatformsWindows 2000 – Windows XP, OSX, Solaris 9,Linux (<strong>of</strong>ficial support for Sun Java Desktop andRed Hat Enterprise Linux 3)PricingEnterprise: new – $3,500; upgrade – $1,900.Developer: new – $500; upgrade – $299.Foundation: free (including for commercial use)Test EnvironmentDell Inspiron 8200, 2GHz Intel P4 processor, 60GBdisk, 1GB <strong>of</strong> RAM, Windows XPprojects spend thousands <strong>of</strong> dollarson products for this specific item.It should be mentioned that some<strong>of</strong> the best features <strong>of</strong> JBuilder are notintuitively obvious, like intelligentcode editing. For instance, the smartpaste feature, through refactoring,cuts several lines <strong>of</strong> code and pastesthem in another class, and JBuilderasks if the associated imports shouldbe added.JDK 5A noteworthy must-have forJBuilder 2005 is its support for JDK 5.Provided support includes help iden-48 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


Advertiser IndexAdvertiser URL Phone PageAltova www.altova.com 978-816-1600 4Common Controls www.common-<strong>con</strong>trols.com +49 (0) 6151/13 6 31-0 45CTIA Wireless 2005 www.ctia.org 301-694-5243 47EclipseCon 2005 www.eclipse<strong>con</strong>.org 503-252-2458 43EV1 Servers www.ev1servers.net 800-504-SURF 13Fitech Laboratories, Inc. www.fitechlabs.com/grid 646-495-5076 27Google www.google.com/jdj 650-623-4000 33Information Storage & Security Journal www.issjournal.com 888-303-5282 49InstallShield www.installshield.com/jdj 800-809-5659 21InterSystems www.inter<strong>sys</strong>tems.com/match3 617-621-0600 Cover IVIT Solutions Guide www.<strong>sys</strong>-<strong>con</strong>.com/itsolutions 888-303-5282 61LinuxWorld Conference & Expo www.linuxworldexpo.com 508-424-48<strong>10</strong> 41M7 www.m7.com/d7.do 866-770-9770 29Micros<strong>of</strong>t msdn.micros<strong>of</strong>t.com/visual Cover IINorthwoods S<strong>of</strong>tware Corp. www.nwoods.com/go 800-434-9820 39Paras<strong>of</strong>t Corporation www.paras<strong>of</strong>t.com/jtest_jdj 888-305-0041 9PointBase www.pointbase.com 877-238-8798 37ReportingEngines www.reportingengines.com/download/f1ere.jsp 888-884-8665 17S<strong>of</strong>tware FX www.s<strong>of</strong>twarefx.com 800-392-4278 Cover IIIWebRenderer www.webrenderer.com 7Web Services Edge 2005 East www.<strong>sys</strong>-<strong>con</strong>.com/edge 201-802-3069 51-60General Conditions: The Publisher reserves the right to refuse any advertising not meeting the standards that areset to protect the high editorial quality <strong>of</strong> Java Developer’s Journal. All advertising is subject to approval by thePublisher. The Publisher assumes no liability for any costs or damages incurred if for any reason the Publisherfails to publish an advertisement. In no event shall the Publisher be liable for any costs or damages in excess<strong>of</strong> the cost <strong>of</strong> the advertisement as a result <strong>of</strong> a mistake in the advertisement or for any other reason. TheAdvertiser is fully responsible for all financial liability and terms <strong>of</strong> the <strong>con</strong>tract executed by the agents or agencieswho are acting on behalf <strong>of</strong> the Advertiser. Conditions set in this document (except the rates) are subjectto change by the Publisher without notice. No <strong>con</strong>ditions other than those set forth in this “General ConditionsDocument” shall be binding upon the Publisher. Advertisers (and their agencies) are fully responsible for the<strong>con</strong>tent <strong>of</strong> their advertisements printed in Java Developer’s Journal. Advertisements are to be printed at thediscretion <strong>of</strong> the Publisher. This discretion includes the positioning <strong>of</strong> the advertisement, except for “preferredpositions” described in the rate table. Cancellations and changes to advertisements must be made in writingbefore the closing date. “Publisher” in this “General Conditions Document” refers to <strong>SYS</strong>-<strong>CON</strong> Publications, Inc.This index is provided as an additional service to our readers. The publisher does not assume any liability for errors or omissions.


LabsFigure 2 JSF Smart Tagstifying <strong>con</strong>flict issues for situationsin which you name a variable enum(which is now a keyword). It also providessupport for generics, foreach,autoboxing, and the added Javadoctags. It even provides a refactoringwizard to migrate iterating loops tothe new foreach approach. However,its JDK 5 support isn’t complete:among the deficiencies is the lack <strong>of</strong>support for static imports.Web DevelopmentThe largest collection <strong>of</strong> musthavefeatures for JBuilder 2005 is thatwhich includes the Web developmenttools. They provide support for JSP 2.0and Servlet 2.4 through support forTomcat 5.0, including JSR 45 debuggingsupport for debugging JSP pages,JavaServer Faces, and Web servicesenhancements.JavaServer Faces support wasinitially a disappointment. However,during Borland’s <strong>con</strong>ference the developer<strong>of</strong> the tool demonstrated someotherwise hidden features in JBuilder,which raised the level <strong>of</strong> value thatJBuilder provides for JSF development.While most other editors are providing<strong>JDJ</strong> Product Snapshotdesign-time WYSIWYG GUI tools forJSF, JBuilder doesn’t. The upside to thisapproach isn’t self-evident. The JSFspecification doesn’t standardize toolsupport, so whatever tool you use, ithas its own proprietary approach fordesigning JSF. The pro with JBuilder isit doesn’t lock you in and you can useJBuilder to work on projects originatingin another editor. The downside isWYSIWYG is nice and isn’t availablehere. Of course, maybe we shouldbe upset with the JCP on this one.JBuilder’s JSF support is geared towork specifically with the referenceimplementation from Sun. I’ve hadsome success in getting it to work withMyFaces implementation, but yougive up some features when doing so.The tag component palette initiallyseems like a bad idea, at least for seasoneddevelopers, as it takes up valuablescreen real estate and provideslittle value…until you drag a “smart”component onto a JSP page (I’m stillnot sure how to distinguish the smarttags from the dumb tags). Try addinga JSF Input Text Form Row to a JSPpage; it knows that it’s required tobe in a form and that form must beTarget Audience: Java programmersLevel: Beginner to advancedPros:• Best choice for <strong>con</strong>sultants and shops required to support multiple application serverenvironments• JDK 5 support• JSF support• Project structure flexibility• RefactoringCons:• No support for application servers and frameworks released after JBuilder’s release, which includesTomcat 5.5, WebSphere 6.0, and JBoss 4.0in a view. The text in the editor willdynamically change depending onits placement to ensure the nesting<strong>of</strong> tags is correct. Looking at Figure 2,the inserted tag knows it needs moretags in order to work. It also knowsthat it already is in the view tag, whichwould also be inserted if it weren’tpresent. Very cool. With the addedbenefit <strong>of</strong> Tag Insight (which essentiallyis ErrorInsight for tags), the Webdevelopment benefits for 2005 make itworth the upgrade.Additional FeaturesOne <strong>of</strong> my favorite new featuresdoesn’t seem to be documented inwhat’s new. JBuilder now refactorsreferences in XML to classes, whichare refactored. This means that struts<strong>con</strong>fig.xml,web.xml, and all the EJBXML files are correctly updated whena class is renamed or repackaged. Thisis a huge time-saver.Other new features worth the upgrade:Web services WS-I testing tools,distributed refactoring, debuggingAnt and Ant tasks, and Subversionsupport.What to Do…What to DoThe Foundation Edition is a freedownload from Borland and includesmany <strong>of</strong> the editor features as well asmost <strong>of</strong> the refactoring tools. Notablymissing is any Web development orEJB development tools. This editionis a good choice for beginners,organizations that aren’t doing Webor enterprise development, or thoseenvironments that are using othertools for enterprise development suchas xDoclet.The Developer Edition packs thepunch in this release. If you’re notdoing EJB, CORBA, or Web servicesdevelopment, most <strong>of</strong> the best featuresexist in this version.Of course, if you’re like me and youdon’t know what your next server willbe, you have to maintain multipleservers and you don’t want to wastetime tinkering with <strong>con</strong>figurations,or you need one or more the following– Web services tools, advancedOptimizeIT tools (Thread debugger),advanced XML tools, or advanced JUnittests – you’ll need to get the EnterpriseEdition. This is the best option for lesstinkering and more coding.50 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>


TMTMConferenceSee what everyone is talking about… The Application Server Shoot-Out!International Web Services Conference & ExpoCo-LocatingwithLinuxWorld& ExpoKeynotesMatt AckleyeBayAri BixhornMicros<strong>of</strong>tMike MilinkovichEclipse.orgNew for 2005…• Cabana Night Developer Exchange• Application Server Shootoutfacilitated by Burton GroupProduct TeamsDelivering SOA,Web Services,Java, .NET,& XML SolutionsRegisterbyWEBSERVICESEDGE2005 EASTJANUARY 21, 2005SAVE$300UpToSPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MA• Hands On VS and .NET Labs• S<strong>of</strong>tware GiveawayFor more information:visit: www.<strong>sys</strong>-<strong>con</strong>.com/edgecall: 201-802-3066e-mail: jimh@<strong>sys</strong>-<strong>con</strong>.comFree Tutorialspresented byFebruary 15-17, 2005John B. Hynes Convention CenterBoston, MAPRODUCED BY:PRESENTED BY:DIAMONDSPONSOR:GOLDSPONSORS:ASSOCIATIONSPONSORS:CORPORATESPONSOR:APP.-SERVERSHOOTOUTFACILITATOR:MEDIASPONSORS:


International Web ServicSPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MAFebruary 15–17, 2005John B. Hynes Convention CenterBoston, MAThe Largest i-TechnologyEvent <strong>of</strong> the Year!WhoShouldAttendS<strong>of</strong>tware DevelopersS<strong>of</strong>tware EngineersApplication DevelopersDevelopment ManagersTechnical DirectorsAnalysts/ProgrammersIT ManagersCEOsCTOsCIOsTechnical ArchitectsTeam LeadersS<strong>of</strong>tware ConsultantsIT DirectorsProject ManagersWeb Services Edge2005EastFeatures & Attractions3 Days Packed with Education and TrainingKeynotes & Panel Discussions from Industry Leaders50+ Hard-hitting and Informative SeminarsFREE Web Services Tutorial Presented by NovellFREE .NET Tutorial Presented by Micros<strong>of</strong>tFREE Web Services Security TutorialPresented by Critical SitesCabana Night Developer Exchange Presented by INETAPanel Discussions Presented by JCPOpening Night Welcome ReceptionCompelling Case Studies & Best PracticesHands-On Labs Featuring .NET and Visual StudioPresented by Micros<strong>of</strong>t PartnersFeatured Product DemonstrationsExhibit Floor featuring hundreds <strong>of</strong> productsReal-time <strong>SYS</strong>-<strong>CON</strong> Radio InterviewsVISIT www.<strong>sys</strong>-<strong>con</strong>.com/edge FOR TIMES & SCHEDULESThe program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


es Conference & ExpoKeynoteSpeakersTuesday, February 15, 11 a.m.Matt AckleySENIOR DIRECTOR, EBAYDEVELOPERS PROGRAMWeb Services for eCommerceeBay, The World’s Online Marketplace, has morethan 114 million registered users, <strong>10</strong>,000 developers, and over 700 live, third-party applications. Four years ago, eBaybegan allowing third parties to build applications that tap into eBay, and today eBay hosts one <strong>of</strong> the leading Web servicesplatforms. Through its developer program, eBay enables third parties to create cutting-edge Web services applicationsthat benefit the buyers and sellers on eBay. At present, 40% <strong>of</strong> eBay’s listings come through its API, which handlesmore than a billion Web services calls a month. Ackley will discuss the rewards and challenges <strong>of</strong> building andmaintaining one <strong>of</strong> the world’s leading Web services platforms, and share insights and practical guidelines for others.Matt Ackley is senior director <strong>of</strong> the eBay Developers Program. He supports eBay’s vision to be the leading platformfor global online commerce, and is chartered with creating a thriving eco<strong>sys</strong>tem between eBay, its community <strong>of</strong>users, and third-party developers and solution providers. Ackley joined eBay in 2003 as part <strong>of</strong> eBay’s acquisition <strong>of</strong>FairMarket, which provided technology solutions and services to online marketplaces.Wednesday, February 16, 11 a.m.Ari BixhornDIRECTOR, WEB SERVICES STRATEGIES,MICROSOFT CORPORATIONIntroducing Indigo: The Unified ProgrammingModel for Building Service-Oriented ApplicationsIndigo is Micros<strong>of</strong>t’s unified programming model for building service-oriented applications on the Windows platform.It enables developers to build secure, reliable, transacted solutions that integrate across platforms and interoperate withexisting investments. Indigo combines and extends the capabilities <strong>of</strong> existing distributed application technologies, including.NET Enterprise Services, System.Messaging, Remoting, ASMX, and WSE to deliver a unified development experiencespanning distance, topologies, hosting models, protocols, and security models. This keynote will provide an inside look atIndigo and show you how Indigo will radically simplify the development <strong>of</strong> distributed, service-oriented applications.Ari Bixhorn is the director <strong>of</strong> Web Services Strategy in the Developer and Platform Division at Micros<strong>of</strong>t Corp.He is responsible for product planning and technical evangelism for Micros<strong>of</strong>t’s Web services <strong>of</strong>ferings,including “Indigo,” the code name for a component <strong>of</strong> the next version <strong>of</strong> the Windows operating <strong>sys</strong>tem,code-named Windows “Longhorn.” Bixhorn has spent the past five years at Micros<strong>of</strong>t, driving product managementefforts for the Visual Basic and Visual Studio development <strong>sys</strong>tems.Thursday, February 17, 11 a.m.Mike MilinkovichECLIPSE.ORGSPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MAAn Open Development Platform for Web ServicesOpen source technology runs the Internet. Linux, Apache, PHP and Eclipse are highlysuccessful open source communities that provide the backbone for today’s Web applications. All indications point toa <strong>con</strong>tinued value proposition for organizations for leveraging open source when developing and deploying SOAbasedapplications. This keynote will examine the benefits <strong>of</strong> using open source technologies, the decision-makingprocess used when adopting these solutions and the potential for <strong>con</strong>tributing back to the open source community.Mike Milinkovich has held key management positions at Oracle, WebGain, The Object People, and ObjectTechnology International Inc. (which subsequently became a wholly owned subsidiary <strong>of</strong> IBM), assumingresponsibility for development, product management, marketing, strategic planning, finance, and businessdevelopment. Mike earned his MS degree in information and <strong>sys</strong>tems sciences and a bachelor <strong>of</strong>commerce degree from Carleton University in Ottawa, Canada.VISIT www.<strong>sys</strong>-<strong>con</strong>.com/edge FOR TIMES & SCHEDULESThe program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


SPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MAFEBRUARY 15 DAY 1FEBRUARY 16 DAY 2FEBRUARY 17 DAY 37:308:009:00<strong>10</strong>:0011:0012:003:004:005:007:308:009:00<strong>10</strong>:0011:0012:003:004:005:006:007:308:009:00<strong>10</strong>:0011:0012:003:004:00RegistrationJava .NET Web ServicesFREE Tutorial – Ashish Larivee, Novell, Using a Web Services Framework to Build SOA Applications(J-1) What’s New In JDO 2.0 (.NET-1) Intro to SPOT (WS-1) Ensuring Web Services Interoperability(J-2) Using Java Messaging inReal-Time Trading Systems(J-3) The ROI <strong>of</strong> a Java-Rich Client(J-4) Web Services End-to-EndSecurity on J2EE: Gaps andProposed Solutions(J-5) J2ME and Eclipse(J-6) The Impact <strong>of</strong> JBoss and Monoon the Application Server Market(J-7) Migrating Enterprise ApplicationsBetween J2EE Application Servers(.NET-2) An Introduction to SQL ServerReporting ServicesOpening Keynote – Matt Ackley, Senior Director, eBay Developer Program, eBayEXPO OPEN (12 P.M.–5 P.M.)Keynote Panel Presented by JCP – Web Services and SecurityModerator: Onno Kluyt, Sr Director & Chair, JCP Program, Sun Micro<strong>sys</strong>temsOpening Night ReceptionRegistration(.NET-3) Go With TheFlow – Human WorkflowServices in BizTalk 2004(.NET-4) The Micros<strong>of</strong>t Framework: An AgileS<strong>of</strong>tware Development Process for BuildingWeb Service Applications(.NET-5) Securing Service-OrientedArchitecture with Micros<strong>of</strong>t’s WSE 2.0(.NET-6) Web ServicesSecurity for Dummieswith WSE2(.NET-7) So You THINKYou Know What anObject Is…(.NET-3B)Techniques withVisual Basic.NET(.NET-6B) J2EE to.NET Interoperabilityand App. Integration(.NET-7B) Building andUsing AdvancedASP.NET Web Controls(WS-2) Web Services Standards:Going Behind the Mask(WS-3) The XML Data ChallengeJava .NET Web ServicesFREE Tutorial – Thom Robbins, Micros<strong>of</strong>t – The Next Generation <strong>of</strong> Visual Studio (free with VIP preregistration)Keynote – Ari Bixhorn, Director, Web Services Stategies, Micros<strong>of</strong>t CorporationEXPO OPEN (12 P.M.–4 P.M.)Application Server ShootoutCabana Night – Hosted by INETARegistration(WS-4) How To Bulletpro<strong>of</strong> Your Web Services(WS-5) The Role <strong>of</strong> Policy in Web ServicesIntegration – It’s More Than Just Security(WS-6) B2B Policy Enforcement:The Third Rail <strong>of</strong> SOA Implementation(WS-7) Driving SOA GovernanceJava .NET Web ServicesFREE Tutorial – Patrick Hynds and Duane Laflotte, Critical Sites – Security, The New Reality (free with VIP preregistration)(J-8) Design Patterns and ProjectOrganizational Techniques for “WriteOnce, Debug Everywhere”(J-9) Using Grid Computing with WebServices and J2EE to Create InternetbasedSOAs(J-<strong>10</strong>) Java Web ServicesProgramming Tips & Tricks(J-11) JCP Program: How the JavaTechnology Binary S<strong>of</strong>tware Standardis Managed and Evolves(.NET-8) Migrating ASP to ASP.NET(.NET-9) Smart Client Development with theOffline Application BlockKeynote – Mike Milinkovich, Executive Director, Eclipse FoundationEXPO OPEN (12 P.M.–4 P.M.)(.NET-<strong>10</strong>) CLR InternalsVisit Web site for update(WS-2B) Solving Complex Business ProblemsThough SOA(WS-8) SOA: From Pattern to Production(WS-9) High Performance Web Services –Tackling Scalability and Speed(WS-<strong>10</strong>) So You Want an SOA: Best Practicesfor Migrating Toward Service Orientationin the Enterprise(WS-11) Four Abilities SOA Will LackWithout a RegistryThe program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


WS SecurityCase StudyFREE Tutorial –Aaron Williams, JCP, Developing Web Services Using Java Technology(WSS-1) Identity in SOA(WSS-2) Securing Web Serviceswith WS-Security(CS-1) Developing E-Commerce Applicationswith Web Services(CS-2) Developing Enterprise Class Web Services(CS-3) Service-Oriented Development on NetKernel –Patterns, processes and product toreduce the complexity <strong>of</strong> IT <strong>sys</strong>temsFREE Web Services SecurityTutorial Presented by NovellUsing a Web Services Frameworkto Build SOA ApplicationsTuesday, Feb. 158:00 A.M. – 11:00 A.M.FREE Tutorial Presented byJava Community ProcessDeveloping Web ServicesUsing Java TechnologiesTuesday, Feb. 158:00 A.M. – 11:00 A.M.(WSS-3) Anatomy <strong>of</strong> a Web Services AttackWS Security(WSS-4) Using Mobile Phones as an SSOAuthentication Device in SOA Solutions(WSS-5) Building Intelligent Enterprises withNovell’s Identity-Driven Computing(WSS-6) XML Content Attacks(WSS-7) The Interoperability Challenge <strong>of</strong> WebServices Security StandardsWS SecurityCase Study(CS-4) Orchestrating FORCEnet EngagementPacks with BPEL for Web Services(CS-5) CPI: A Globally Integrated Problem-Trackingand Resolution System Using Java Web Services(CS-6) The Transformation <strong>of</strong> SiteRefreshinto a Web ServicesCase StudyFree Tutorials with VIP Preregistration ONLY!FREE.NET TutorialPresented byMicros<strong>of</strong>tThe Next Generation<strong>of</strong> Visual StudioThom RobbinsWednesday, Feb. 168:00 A.M. – 11:00 A.M.Free Tutorials with VIP Preregistration ONLY!SPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MA(WSS-8) Transitioning Successfully to SOAand Web Services: Building the Infrastructurefor SOA GrowthVisit Web site for update(CS-8) Using SOA and Web Services to Issue BusinessLicenses in the District <strong>of</strong> Columbia(CS-9) Developing Web Services with EclipseFREE.NET TutorialPresented byCritical SitesSecurity,The New RealityPatrick HyndsThursday, Feb. 178:00 A.M. – 11:00 A.M.Free Tutorials with VIP Preregistration ONLY!The program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


International Web ServicSPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MAJAVA TRACKJ-1 What’s New In JDO 2.0PATRICK LINSKEY,SOLARMETRICTuesday, Febuary 15, 2005 9:00 A.M. – 9:50 A.M.In this presentation, SolarMetric’s CTO Patrick Linskey introduces JDO, thestandards-based object persistence specification, and the new changesintroduced with the release <strong>of</strong> JDO 2. Developers using JDO are seeingincreased application portability, reduced development cycle time, improvedcode quality, higher performance, and more manageable scalability. Thesession will highlight the problems <strong>of</strong> persisting data to a database and thebasics <strong>of</strong> JDO. Patrick will focus on what’s new with JDO 2, including theimprovements and alternatives to the JDO Query Language, detached databaseoperations, and the new metadata for object / relational mapping.BIO: Patrick Linskey has been working with Java Data Objectsfor over 3 years and has been involved in object/relational mappingfor 5+ years. As the founder and CTO <strong>of</strong> SolarMetric, Patrickdrives the technical direction <strong>of</strong> the company. Patrick is a luminary onJDOcentral, a <strong>con</strong>sortium committed to marketing the JDO standard. Hehas been one <strong>of</strong> the leaders on the JDO specification team, currently helpingto drive the JDO 2.0 specification.J-2 Using Java Messaging inReal-Time Trading SystemsYAKOV FAIN,SMART DATA PROCESSING,INC.Tuesday, Febuary 15, 2005 <strong>10</strong>:00 A.M. – <strong>10</strong>:50 A.M.Any modern financial trading <strong>sys</strong>tem is a complex distributed applicationthat runs on multiple platforms and <strong>con</strong>sists <strong>of</strong> components and servicesthat have to communicate with each other. This presentation is about usingJMS and Message-Oriented Middleware as a backbone that provides a fastand reliable delivery mechanism between various components and tiers <strong>of</strong>such <strong>sys</strong>tems. This presentation is based on my real-world experience indesign, development, and production support <strong>of</strong> an application that had towire together midrange computers with J2EE and LDAP servers, non-Javastock exchange s<strong>of</strong>tware, and mainframe legacy reporting <strong>sys</strong>tems.BIO: Yakov Fain works as a Java architect for a major bank inNew York City. He is a member <strong>of</strong> the editorial board <strong>of</strong> <strong>JDJ</strong>. Yakovhas 23 years <strong>of</strong> experience working in s<strong>of</strong>tware development.J-3 The ROI <strong>of</strong> a Java-Rich ClientCOACH WEI,NEXAWEB TECHNOLOGIESTuesday, Febuary 15, 2005 4:00 P.M. – 4:50 P.M.Rich client, thick client, thin client – what are they? What are the benefits <strong>of</strong>rich client, in particular Java Rich Client? This session presents an overview<strong>of</strong> the various client technologies, in particular various Java-based rich-clientsolutions, including Swing/AWT, SWT, and XML. Further, it analyzes the trade<strong>of</strong>fbetween these different Java-rich client technologies, and presents realworldcase studies to justify the ROI <strong>of</strong> Java-Rich Client solutions.BIO: Coach Wei is founder and CTO <strong>of</strong> Nexaweb Technologies(www.nexaweb.com), which develops the leading s<strong>of</strong>tware platformfor building and deploying Enterprise Internet Applications.Coach has his master’s degree from MIT, holds several patents, is theauthor <strong>of</strong> many technology publications, and is an industry advocate for theproliferation <strong>of</strong> open standards.J-4 Web Services End-to-End Securityon J2EE: Gaps and Proposed SolutionsSUDHIR BHOJWANI,SUSHIL SHUKLA,& SUDHRITY MONDAL, BEAWednesday, Febuary 16, 2005 9:00 A.M. – 9:50 A.M.Even though WS-* security standards (WS-Security, WS-Trust, WS-SecureConversation, WS-Policy, etc.) are sufficiently prescriptive onspecific security subjects like signing, SOAP message encryption,request/receive security tokens, they do not provide end-to-end securityprotocol that Web services can depend on to meet their securityrequirements. The most significant gap is identity propagation from aWeb service into a J2EE <strong>con</strong>tainer. Current JAX-RPC specification orJSR <strong>10</strong>9 does not cover this issue. This presentation identifies the gapsand discusses the approaches to plug these gaps. It also discussesimplementation <strong>of</strong> a solution for identity propagation from client to Webservice and from Web service to J2EE <strong>con</strong>tainer.BIO: Sudhir Bhojwani is a senior architect working for BEATechnical Solutions Group. He has over eight years <strong>of</strong> industryexperience architecting and designing <strong>sys</strong>tems based on componenttechnologies like CORBA and EJBs, and most recently working on SOAprinciples.BIO: Sushil Shukla is a principal architect working for BEATechnical Solutions Group. He has 19 years <strong>of</strong> industry experienceand 9 years <strong>of</strong> architecting and designing application serverbasedlarge <strong>sys</strong>tems. He has extensive experience with tools and technologiesused in developing mission-critical applications.BIO: Sudhrity Mondal is a principal architect working for BEATechnical Solutions Group. He has 14 years <strong>of</strong> industry experienceand specializes in Java technology, enterprise integration solutions,object-oriented s<strong>of</strong>tware design, and development and s<strong>of</strong>tware patterns. Hehas helped prominent BEA Customers to architect, design, and implementnew <strong>sys</strong>tems using Tuxedo, J2EE, and Web services over the past eight years.J-5 J2ME and EclipseMICHAEL VAN MEEKEREN, IBMWednesday, Febuary 16, 2005 <strong>10</strong>:00 A.M. – <strong>10</strong>:50 A.M.Eclipse provides support for Java program development such as editing,compiling, and debugging, and is readily extensible through its plug-inmechanism. Many have been involved in the development <strong>of</strong> plug-ins thatsupport the building and launching <strong>of</strong> embedded applications (with supportfor various platforms, such as J2ME/MIDP, PocketPC, and PalmOS). This talkwill show how applications can be developed, compiled, analyzed, andcompressed to fit on really small devices. It will include reports on practicalexperience, it will provide background information on developing Javaapplications for resource-<strong>con</strong>strained environments, and explain what Javastandardization processes are under way.BIO: Michael Van Meekeren has been a senior developer withIBM Ottawa Labs (formerly known as Object TechnologyInternational) since 1994, and has played an active role in thedevelopment <strong>of</strong> Envy/Developer, IBM Smalltalk, VisualAge for Java, andWebSphere Studio Device Developer. Michael is currently the IBM EclipsePlatform UI Team Lead at IBM Ottawa Labs.J-6 The Impact <strong>of</strong> JBoss and Mono on theApplication Server MarketPIERRE FRICKE,D.H.BROWN ASSOCIATESWednesday, Febuary 16, 2005 4:00 P.M. – 4:50 P.M.Linux and Apache drove a dramatic change in the server operating <strong>sys</strong>tem andWeb server marketplaces. These areas, dominated by Micros<strong>of</strong>t and Sun in thelate 1990s, now see leading open source alternatives challenging these leaders.But open source’s impact doesn’t stop there. JBoss, the open source J2EE platform,is becoming the high-volume leader in the J2EE application space. Morerecently, Mono, the open source implementation <strong>of</strong> Micros<strong>of</strong>t .NET, promises tobe a main strategic item for Novell. Mono may extend Micros<strong>of</strong>t’s hegemony intoLinux and open-source by countering J2EE’s cross-platform strategic advantage.BIO: Pierre Fricke, D.H. Brown’s vice president <strong>of</strong> Application andIntegration Infrastructure, extends the company’s unique technicaland strategic analysis into the J2EE, Micros<strong>of</strong>t .NET, and integrationinfrastructure space. After completing his M.B.A., Pierre became one <strong>of</strong> theleading strategists and marketing leaders in IBM focusing on interoperability,integration, WebSphere, Windows NT, UNIX, as well as Linux and open source.VISIT www.<strong>sys</strong>-<strong>con</strong>.com/edge FOR TIMES & SCHEDULESThe program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


es Conference & ExpoJ-7 Migrating Enterprise ApplicationsBetween J2EE Application ServersAJIT SAGAR,INFO<strong>SYS</strong> TECHNOLOGIES,LTDWednesday, Febuary 16, 2005 5:00 P.M. – 5:50 P.M.This session will provide guidelines, best practices, and a methodology totackle a problem that is sapping the budgets <strong>of</strong> enterprise which haveinvested heavily in J2EE technology – the migration <strong>of</strong> enterprise applicationsbetween J2EE application servers. The strategy and planning for suchinitiatives is very complex and requires planning in advance. Enterpriseapplications, once deployed, have a multitude <strong>of</strong> dependencies, besides thedependency on Java APIs. The drivers for migration can include versionupgrades, corporate agenda, maintenance costs, industry alliances, rapidupgrades to the J2EE platform APIs, etc. A planned migration ensures asuccessful implementation while minimizing the impact. This session willdescribe a strategy to plan for the migration <strong>of</strong> large portfolios <strong>of</strong> applicationsbetween application server vendors, between application server versions,and between hardware platforms. Real world examples <strong>of</strong> how thisstrategy has been applied in the industry will be provided.BIO: Ajit Sagar is a senior technical archiect with Info<strong>sys</strong>Technologies, Ltd., a global <strong>con</strong>sulting and IT services company. Ajithas been working with Java since 1997, and has more than 15 years’experience in the IT industry. Ajit has served as <strong>JDJ</strong>’s J2EE editor, was the foundingeditor <strong>of</strong> XML-Journal, and has been a frequent speaker at <strong>SYS</strong>-<strong>CON</strong>’s WebServices Edge series <strong>of</strong> <strong>con</strong>ferences. He has published more than 75 articles.J-8 Design Patterns and ProjectOrganizational Techniques for“Write Once, Debug Everywhere”DR. MICHAEL JUNTAO YUAN, UNIVERSITY OF TEXASThursday, Febuary 17, 2005 9:00 A.M. – 9:50 A.M.Unlike the wildly successful server-side Java technology, the true “write oncerun anywhere” vision has never been achieved for client-side Java. For Javadevelopers <strong>of</strong>fering end-to-end smart client–based SOA solutions, the developmentprocess is still “write once, debug everywhere.” As the client-side platformsevolve from a handful <strong>of</strong> PC OSs to hundreds <strong>of</strong> devices with differentOSs and UI characteristics, developers must leverage design patterns and innovativeproject organizational techniques to smooth the development and optimizationprocess. This session will introduce more than a dozen <strong>of</strong> those designpatterns and organizational techniques based on Michael’s experience workingwith Nokia developers to develop scalable mobile enterprise applications.BIO: Dr. Michael Juntao Yuan is an author, developer, and s<strong>of</strong>tware architectfor end-to-end mobile s<strong>of</strong>tware. He is a <strong>con</strong>tributing editor to <strong>JDJ</strong> anda frequent <strong>con</strong>tributor to many developer forums and publications. He is theauthor <strong>of</strong> two books.J-9 Using Grid Computing with Web Servicesand J2EE to Create Internet-based SOAsKIERAN TAYLOR, AKAMAIThursday, Febuary 17, 2005 <strong>10</strong>:00 A.M. – <strong>10</strong>:50 A.M.Service-oriented architecture, Web services, and J2EE technologies aredramatically changing the ways in which enterprises develop and deploytheir Internet-facing applications. Because these applications potentiallyhave a global user base, correctly architecting applications is a particularchallenge. A combination <strong>of</strong> grid computing and utility computing <strong>of</strong>fers away to provide computing resources when and where they are needed, butdevelopers must factor in certain <strong>con</strong>siderations during design. This sessionwill provide an in-depth overview <strong>of</strong> three real-world case studiesusing Grid computing in combination with Web services and J2EE to createInternet-based SOAs. It is designed for application architects and developers,and attendees will learn how applications can be designed to operatein a distributed computing environment such that performance and scalabilityproblems are bypassed during deployment.BIO: Kieran Taylor is currently the director <strong>of</strong> product managementfor Akamai Technologies and focuses strategy and direction forAkamai’s emerging technologies, including its J2EE Internet applicationsdelivery services. While at Akamai, Taylor has helped promote theopen-standard Edge Side Includes (ESI), a markup language for dynamic <strong>con</strong>tentassembly and delivery at the edge, in use today by many companies.J-<strong>10</strong> Java Web Services Programming Tips & TricksANDRÉ TOST, IBMThursday, Febuary 17, 2005 3:00 P.M. – 3:50 P.M.This session will present a collection <strong>of</strong> programming tips and tricks related to<strong>con</strong>suming and providing Web services in Java. This collection has been createdby a number <strong>of</strong> developers and <strong>con</strong>sultants and is the result <strong>of</strong> many real-lifeproject experiences. We will focus on implementation aspects for Web servicesand not go into any detail on architecture or <strong>con</strong>ceptual issues. In other words,these are the problems that developers face once they have started coding.BIO: André Tost works as a solution architect in IBM’s S<strong>of</strong>twareGroup, where he focuses on SOA and Web services technology.He primarily engages with IBM’s strategic business partners toenable them for J2EE and Web services. Before his current assignment, hespent many years in various IBM product development groups.J-11 JCP Program: How the Java TechnologyBinary S<strong>of</strong>tware Standard is Managed and EvolvesONNO KLUYT,SR.DIRECTOR & CHAIR, JCP PROGRAM,SUN MICRO<strong>SYS</strong>TEMSThursday, Febuary 17, 2005 4:00 P.M. – 4:50 P.M.Why a Java technology standard? Why technology communities? This sessionwill explore the circle <strong>of</strong> adoption and business opportunity from an ITManager and IT developer perspective. How Java technology fits into thesecircles, and the significance <strong>of</strong> <strong>con</strong>formance and the “Write Once, RunAnywhere” promise. The role the Java Community Process (JCP) programplays by carefully focusing on binary compatibility and bringing together thecommunity to agree on standards and the results <strong>of</strong> this effort – multipleimplementations from many sources based on Java technology.BIO: Onno Kluyt is chair <strong>of</strong> Java Community Process (JCP)Program, Senior Director, JCP Program and Jini Program, SunMicro<strong>sys</strong>tems. Onno leads the Program Office for the JCP, whichoversees the process, manages its membership, guides specification leadsand experts through the process, leads the Executive Committee meetings,and manages the JCP.org Web site. Onno also heads up the JINI program,including JINI technology and JINI community.Attend a FREE * TutorialTuesday, February 15, 2005, 8 – 11 a.m.AARON WILLIAMSDeveloping Web Services UsingJava TechnologiesAARON WILLIAMS,MANAGER,JAVA COMMUNITY PROCESSPROGRAM OFFICE,SUN MICRO<strong>SYS</strong>TEMSWhy do developers favor Java technology for developing Webservices? Java technology is the most ready platform for Webservices and service-oriented architectures, complete withinteroperability, platform independence, and security built in.This tutorial will review several Java technologies for Web servicesstandards that have been developed or are currentlybeing updated through the Java Community Process (JCP) programas JSRs – Java API for XML-based RPC (JAX-RPC), JavaAPI for XML Binding (JAXB), Java API for XML Processing(JAXP), Java API for XML Registries (JAXR), JSR <strong>10</strong>9,Implementing Java Web Services, JSR 172, J2ME Web Servicesand JSR 173, The Streaming API for XML (StAX). Also to behighlighted: JSR 244, Java 2 Platform, Enterprise, Edition 5.0Specification, JSR 181, Web ServicesMetadata for the Java Plaform, JSR208, and Java Business Integration.* Free Tutorials with VIP Preregistration ONLY!SPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MAVISIT www.<strong>sys</strong>-<strong>con</strong>.com/edge FOR TIMES & SCHEDULESThe program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


International Web ServicSPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MAWEB SERVICES TRACKWS-1 Ensuring Web Services InteroperabilityCHRIS FERRIS, IBMTuesday, Febuary 15, 2005 9:00 A.M. – 9:50 A.M.Despite the open industry standards that underlie Web services, interoperabilityhas been a key challenge for vendors and customers implementingWeb services. One reason for this is that the relevant industry standards<strong>of</strong>ten permit multiple acceptable implementation alternatives. This presentationwill discuss in detail the challenge <strong>of</strong> Web services interoperability andthe role played by the premier industry organization formed to address it, theWeb Services Interoperability Organization. In particular, the presentation willcover the critical importance <strong>of</strong> WS-I pr<strong>of</strong>iles to an organization’s Web servicesinitiatives, including the manner in which companies can put WS-I pr<strong>of</strong>ilesimmediately to work.BIO: Chris Ferris is chair <strong>of</strong> the WS-I Basic Pr<strong>of</strong>ile Working Groupand a senior technical staff member with IBM’s EmergingTechnology Group. He has been actively engaged in open standardsdevelopment for XML and Web services since 1999 and is an electedmember <strong>of</strong> the OASIS Technical Advisory Board. Chris is also a coauthorand editor <strong>of</strong> the WS-Reliable Messaging specification.WS-2 Web Services Standards:Going Behind the MaskGLEN DANIELS, SONIC SOFTWARETuesday, Febuary 15, 2005 <strong>10</strong>:00 A.M. – <strong>10</strong>:50 A.M.Web services and service-oriented architectures (SOAs) are emerging as anintegral part <strong>of</strong> the enterprise IT strategy. According to a recent IDC study,Web services – related revenue is expected to triple from $1.1 billionworldwide in 2003, to $3.4 billion in 2004, and $16.6 billion by 2008. AsSOAs proliferate and the number <strong>of</strong> Web services added to them increases,standards will play an increasingly significant role. This session will look atthe state <strong>of</strong> key Web services standards such as WS-Choreography, WS-Reliability and WS-ReliableMessaging, SOAP/MTOM/XOP, WSDL, XPath,XQuery, and WS-Notification as well as related Java standards and opensource efforts. It will also look at the organizational impact <strong>of</strong> standardsadoption in the industry.BIO: Glen Daniels is manager <strong>of</strong> standards and <strong>con</strong>sortia at SonicS<strong>of</strong>tware and coauthor <strong>of</strong> Building Web Services with Java. He hasbeen working with Web services technologies since their inceptionin the late ’90s, and in addition to developing products and helping to foundApache’s Axis project, he has been an active participant in standards bodiessuch as the W3C, and a member <strong>of</strong> the SOAPBuilders interoperability group.WS-2B Solving Complex Business ProblemsThough SOAJOHN DALY, NETNUMINATuesday, Febuary 15, 2005 3:00 P.M. – 3:50 P.M.WS-3 The XML Data ChallengeNANCY VODICKA,DATADIRECT TECHNOLOGIESTuesday, Febuary 15, 2005 4:00 P.M. – 4:50 P.M.Most businesses store and query data with relational databases but need touse Extensible Markup Language (XML) to exchange and display data onthe Web and with vendors and partners. As a result, programmers need todeal with both relational and XML data, <strong>of</strong>ten at the same time. Emergingstandards such as XQuery, XQJ, and SQL/XML, promise to revolutionize dataexchange and the ways applications are developed, deployed, and utilized.Learn the key facts about these standards, including what they mean, whenthey will be available, and what you, the developer, can do to prepare.BIO: As the XML Product Manager at DataDirect Technologies, NancyVodicka is responsible for DataDirect Connect for SQL/XML, a databaseindependentSQL/XML implementation that is currently shipping, andDataDirect XQuery, a database-independent XQuery implementation that iscurrently in development. Nancy has more than 15 years experience in thes<strong>of</strong>tware industry working with technologies such as XML, Web services,relational databases, and SQL.WS-4 How To Bulletpro<strong>of</strong> Your Web ServicesDAVID MCCAWS,PARASOFTWednesday, Febuary 16, 2005 9:00 A.M. – 9:50 A.M.Web services are gaining industry-wide acceptance and usage and aremoving from pro<strong>of</strong>-<strong>of</strong>-<strong>con</strong>cept deployments to actual usage in mission-criticalenterprise applications. Web services range from major services such asstorage management and customer relationship management to muchmore limited services such as furnishing stock quotes or providing weatherinformation. As companies and <strong>con</strong>sumers begin to rely more and more onWeb services, the need for developing reliable, high-quality Web services iseven stronger. This session will explain issues specific to Web services andwill illustrate solid engineering and testing practices required to ensurecomplete Web service functionality, interoperability, and security. Whethercreating Web services from scratch or integrating a legacy back-end servervia Web services, the practices and principles outlined in this session willbe <strong>of</strong> great benefit.BIO: David McCaw has over eight years <strong>of</strong> experience in helpings<strong>of</strong>tware development teams improve quality throughout thedevelopment process. Over the last three years, he has led theParas<strong>of</strong>t Web Services Solutions team, which has developed an industryleadingapproach for Web services testing. He has implemented Web servicequality solutions for development groups in organizations such asSabre-Holdings, Yahoo! Overture, and McGraw-Hill. McCaw has an extensivebackground in the areas <strong>of</strong> Java and Web service reliability, performance,and security. He is involved with OASIS and WS-I, and is a frequentspeaker at industry events.WS-5 The Role <strong>of</strong> Policy in Web ServicesIntegration – It’s More Than Just SecurityTOUFIC BOUBEZ,LAYER 7 TECHNOLOGIESWedneday, Febuary 16, 2005 <strong>10</strong>:00 A.M. – <strong>10</strong>:50 A.M.Too <strong>of</strong>ten today the preferences, terms, and <strong>con</strong>ditions describing how aWeb service behaves when discovered and invoked is programmed right intothe business logic. Hard-coding this behavior logic however introduces cost,complexity, and rigidity into a Web services architecture. A better approach isto abstract a Web services usage “policy” out <strong>of</strong> code where this metadatacan be managed as need be. This session introduces the <strong>con</strong>cept <strong>of</strong> WebServices Policy and describes how the <strong>con</strong>struct can be used to implement amore customized and versatile Web service infrastructure.BIO: Toufic Boubez is a well-respected and renowned Web servicesvisionary. Prior to c<strong>of</strong>ounding Layer 7 Technologies, Toufic wasthe chief Web services architect for IBM’s S<strong>of</strong>tware Group and drovetheir early XML and Web services strategies. He is a sought-after presenterand has chaired many XML and Web services <strong>con</strong>ferences. He is an author <strong>of</strong>many publications and his most recent book is the top-selling Building WebServices with Java: Making Sense <strong>of</strong> XML, SOAP, WSDL ,and UDDI.WS-6 B2B Policy Enforcement:The Third Rail <strong>of</strong> SOA ImplementationALISTAIR FARQUHARSON,DIGITAL EVOLUTIONWednesday, Febuary 16, 2005 4:00 P.M. – 4:50 P.M.One <strong>of</strong> the great benefits <strong>of</strong> a service-oriented architecture is the ability itgives you to extend programmatic, integration capabilities to business part-VISIT www.<strong>sys</strong>-<strong>con</strong>.com/edge FOR TIMES & SCHEDULESThe program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


es Conference & Exponers. Going beyond simple sharing <strong>of</strong> data with partners, SOA enables trueB2B application integration. At the same time, this capability creates a vexingsecurity policy enforcement dilemma. How can you be sure that a userfrom a partner organization is actually authorized to integrate with yourapplications? How can you authenticate that user? Do you even want thatheadache in the first place? This session will discuss the issues that arisein B2B security policy enforcement and explore several proven approachesto solving the problem. In particular, it will focus on the emerging technology<strong>of</strong> XML Virtual Private Networks (XML-VPNs) and their potential to mitigatesecurity policy enforcement issues in B2B SOA implementations.BIO: Alistair Farquharson is the CTO <strong>of</strong> Digital Evolution, wherehe spearheads product development and provides thought leadershipto enterprise customers implementing Web services. Hisskills span many industries and include designing and implementing <strong>sys</strong>temarchitectures, as well as spearheading initiatives such as development/teamlead. He is an expert in custom-application development, distributedenvironments, architecting scalable hardware and s<strong>of</strong>tware applicationsand <strong>sys</strong>tems, and Web services application development.WS-7 Driving SOA GovernanceBRENT CARLSON,LOGICLIBRARYWednesday, Febuary 16, 2005 5:00 P.M. – 5:50 P.M.In the past year, Web services and service-oriented architectures (SOAs) havebecome mainstream because <strong>of</strong> their ability to provide business agility andflexibility through integration, productivity, and reuse. With SOA enablementon the rise, IT groups must address SOA governance as a means <strong>of</strong> <strong>con</strong>trollingwhat and how services located within an SOA are deployed. This sessionwill discuss SOA governance, specifically how an organization can manageand <strong>con</strong>trol assets and artifacts located within an enterprise, while ensuringthat deployed assets meet an organization’s business and technical architecturalstandards. It will also outline governance best practices such as monitoringthe UDDI publish process in order to seamlessly tie together the developmentand operational views <strong>of</strong> Web services within the enterprise.BIO: Brent Carlson drives the development and delivery <strong>of</strong>LogicLibrary’s products. He is a 17-year veteran <strong>of</strong> IBM, where heserved as lead architect for the WebSphere Business Componentsproject and held numerous leadership roles on the “IBM San FranciscoProject.” He is a member <strong>of</strong> the Eclipse Board <strong>of</strong> Stewards and a BEARegional Director.WS-8 SOA: From Pattern to ProductionDAVID CHAPPELL, SONIC SOFTWAREThursday, Febuary 17, 2005 9:00 A.M. – 9:50 A.M.Service-oriented architecture (SOA) represents the opportunity to achievebroad-scale interoperability, while providing the flexibility required to <strong>con</strong>tinuallyadapt technology to business requirements. No small feat, particularlywhen one <strong>con</strong>siders the extent and complexity <strong>of</strong> today’s IT environments.As both a technology <strong>con</strong>cept and IT discipline, the challenge inherent inSOAs is maintaining the right architectural approach. If all services in anSOA are treated as interdependent point-to-point interfaces, then thecomplexity <strong>of</strong> implementing and maintaining them in this spaghetti-likearchitecture becomes enormous. The enterprise service bus (ESB) hasemerged as one <strong>of</strong> the first true SOA product <strong>of</strong>ferings, bringing SOAfrom pattern to production. ESBs provide a framework for building anddeploying an event-driven, enterprise SOA and accommodates the <strong>con</strong>figuration,hosting, and management <strong>of</strong> integration components as servicesacross the business.BIO: VP and chief technology evangelist for Sonic S<strong>of</strong>tware,Dave Chappell has over 18 years <strong>of</strong> experience in the s<strong>of</strong>twareindustry covering a broad range <strong>of</strong> roles including R&D, codeslinger,sales, support, and marketing. He also has extensive experiencein distributed computing, including message-oriented middleware,CORBA, COM, and Web application server infrastructure.WS-9 High Performance Web Services –Tackling Scalability and SpeedSAMEER TYAGI, SUN MICRO<strong>SYS</strong>TEMSThursday, Febuary 17, 2005 <strong>10</strong>:00 A.M. – <strong>10</strong>:50 A.M.Web services facilitate application-to-application integration and interoperabilityacross different platforms. However, critics usually point to aninefficient processing model and bandwidth requirements for developingWeb services. This is <strong>of</strong>ten cited as a reason why Web services cannotperform and scale well in production environments. This session takes adetailed look at performance and scalability issues around Web servicesin the real world, as well as strategies that architects and developerscan adopt to mitigate such risks in these applications. Some analyticaland modeling strategies that enable acceptable application performancewill also be covered.BIO: Sameer Tyagi works as a senior Java architect with SunMicro<strong>sys</strong>tems. He remains focused on architecture, design,and implementation <strong>of</strong> large-scale enterprise applications withJava technology. His publications include industry periodicals and bookson Java and J2EE technologies including Java Web ServicesArchitecture.WS-<strong>10</strong> So You Want an SOA: Best Practicesfor Migrating Toward Service Orientationin the EnterpriseERIC NEWCOMER, IONAThursday, Febuary 17, 2005 3:00 P.M. – 3:50 P.M.Replacing complex, monolithic applications with nimble applications builtfrom exposed services promises increased developer productivity, greaterflexibility, and ultimately reduced cost. The adoption <strong>of</strong> Web services andSOA can also remove a significant level <strong>of</strong> complexity and integration problemsfrom enterprise application development projects. But, as with anylarge-scale project, IT departments must have the right plan and the rightresources in place to ensure a successful transformation <strong>of</strong> their computinginfrastructure. This article will explore what IT organizations need to knowto be successful in their attempts to migrate the enterprise to a service-orientedarchitecture.BIO: In the role <strong>of</strong> chief technology <strong>of</strong>ficer at IONA, EricNewcomer is responsible for IONA’s technology roadmap and thedirection <strong>of</strong> IONA’s e-business platforms as relates to standardsadoption, architecture, and product design.WS-11 Four Abilities SOA Will LackWithout a RegistryLUC CLEMENT,<strong>SYS</strong>TINETThursday, Febuary 17, 2005 4:00 P.M. – 4:50 P.M.A service-oriented architecture (SOA) is the design blueprint for seamless<strong>con</strong>nectivity between business processes and IT infrastructure, enablinginnovation and improving productivity. SOA provides the most efficient,standard way to dynamically interoperate with any customer, supplier,product or employee. SOA makes integration intrinsic. Web services arethe foundation building blocks <strong>of</strong> an SOA, and they are already proliferatinginside most enterprises. In an SOA, Web services become business serviceswith the ability to perform a particular function or access data dynamically.This presentation will discuss the four abilities that a registry providesfor an SOA.BIO: Luc Clement is director <strong>of</strong> product marketing, SOA Registryfor Systinet. He is also cochair for the UDDI SpecificationTechnical Committee. Formerly Micros<strong>of</strong>t UDDI Program Manager,Luc is well known in the UDDI community and has been heavily involvedwith the UDDI specification for several years.Register byJANUARY 21, 2005UPSAVE $ 300TORegister Today!www.<strong>sys</strong>-<strong>con</strong>.com/edge2005SPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MAVISIT www.<strong>sys</strong>-<strong>con</strong>.com/edge FOR TIMES & SCHEDULESThe program, including topics and times, is subject to change. Please refer to www.<strong>sys</strong>-<strong>con</strong>.com for all updates.


and manages the JCP.org Web site. Onno also heads up the JINI program, including JINI technology and JINI community.International Web Services Conference & ExpoRegisterbySPECIAL INSERT: WEB SERVICES EDGE 2005WWW.<strong>SYS</strong>-<strong>CON</strong>.COM/EDGEFEBRUARY 15-17, 2005JOHN B. HYNES <strong>CON</strong>VENTION CENTER • BOSTON, MA123For Assistance Tel: 201-802-3066 Fax: 201-782-9601<strong>CON</strong>FERENCE & EXPO: February 15 – 17, 2005John B. Hynes Veteran Memorial Convention Center • Boston, MATHREE WAYS TO REGISTER FOR <strong>CON</strong>FERENCE1) On the Web: Credit Cards or “Bill Me” Please make checks payable to <strong>SYS</strong>-<strong>CON</strong> Events2) By Fax: Credit Cards or “Bill Me” 201-782-96013) By Mail: 135 Chestnut Ridge Road, Montvale, New Jersey 07645, Attention: RegistrationPlease note: Registrations are not <strong>con</strong>firmed until payment is received.Please complete sections 1, 2, 3 and 4YOUR INFORMATION (Please Print) Mr. Ms. Mrs.First Name ________________________________Last Name __________________________________________Title __________________________________________________________________________________________Company ______________________________________________________________________________________Street ________________________________________________________________________________________Mail Stop ______________________________________________________________________________________City __________________________________________________________________________________________State________________________________Zip ____________________Country __________________________Phone ________________________________________________________________________________________Fax_______________________________E-Mail ______________________________________________________PAYMENT METHOD: (Payment in full due with registration)Check or Money Order Enclosed (Registration <strong>con</strong>firmed upon receipt <strong>of</strong> payment)Check #_______________________________________ Amount <strong>of</strong> Check $ ______________Charge my Visa MasterCard American Express DiscoverName on card_________________________________________________________________Card #______________________________________________ Exp. Date______________Signature_____________________________________________________________________Billing Address (if different from mailing address)_______________________________________________________________________PLEASE INDICATETotal Registration fee $____________YOUR <strong>CON</strong>FERENCE CHOICE:On SiteBefore 12/31/04 Before 1/21/05 Before 2/11/05 3D: Three Day Conference $1,195.00 $1,395.00 $1,495.00 $1,695.00Good for all three days <strong>of</strong> the <strong>con</strong>ferenceprogram, including keynotes, all <strong>con</strong>ferencesessions. 2D: Two Day Conference $995.00 $1,195.00 $1,295.00 $1,395.00Good for two days <strong>of</strong> the <strong>con</strong>ferenceprogram, including keynotes, all <strong>con</strong>ferencesessions. 1D: One Day Conference $595.00 $695.00 $695.00 $795.00Good for one day <strong>of</strong> the <strong>con</strong>ferenceprogram, including keynotes, all <strong>con</strong>ferencesessions. VIP PASS FREE FREE FREE $75.00FREE Tutorials with VIP preregistration FREE - Novell Tutorial (Feb. 15) FREE - Developing Web ServicesUsing Java Technology (Feb. 15) FREE - The Next Generation <strong>of</strong>Visual Studio (Feb. 16) FREE - Security, The New Reality (Feb. 17) EO: Expo Hall Only FREE FREE FREE $50.00Includes keynotes, expo presentations,and workshopsSPECIAL GROUP RATESRegistering a group <strong>of</strong> four or more? Please call Jim Hanchrow at 201-802-3066,and receive an additional discount.4A. Your Job Title Senior S<strong>of</strong>tware Developer/Engineer/Architect/Analyst Director <strong>of</strong> IT/Development/Engineering S<strong>of</strong>tware Developer/Engineer/Architect Systems Architect/Engineer/Analyst S<strong>of</strong>tware Consultant/Analyst Project Manager/Team Leader Business Development General Manager/Division or Department Head CTO,CIO, Chief Architect CEO, President, Owner, Partner/Principal VP/Technical Director Network Administration/Manager/Consultant Web Developer/Programmer Database Administrator VP/Sales & Marketing Director /Product Management Other (please specify)____________________________B. Business/Industry Agriculture/Mining/Oil/Gas Computer Hardware and Electronics Construction/Architecture/Engineering Consulting (non-computer) Education Banking/Insurance/Accounting Government (including Military) Healthcare/Pharmaceuticals/Biotech/Biomedical Internet/Web/e-Commerce Manufacturing and Process(other than computer related)C. Total Number <strong>of</strong> Employees at Your Location andEntire Organization (check all users that apply):Location Company<strong>10</strong>,000 or more 01 01 5,000 - 9,999 02 02 1,000 - 4,999 03 03 500 - 999 04 04 <strong>10</strong>0-499 05 05 <strong>10</strong>0 or less 06 06 D. Please indicate the value <strong>of</strong> s<strong>of</strong>tware products andservices that you recommend, buy, specify or approveover the course <strong>of</strong> one year: $<strong>10</strong> million or more $1 million - $9.9 million $500,000 - $999,999 $<strong>10</strong>0,000 - $499,999JANUARY 21, 2005SAVE$300 <strong>Media</strong>/Marketing/Advertising Non-Pr<strong>of</strong>it/Trade Association Real Estate/Legal Telecommunications Transportation/Rail/Sea/Air/Ground Travel/Hospitality/Entertainment Utilities Wholesale/Trade/Distribution/Retail Other (please specify)_______________________ $<strong>10</strong>,000 - $99,999 Less than $<strong>10</strong>,000 Don't knowE. What is your company’s gross annual revenue? $<strong>10</strong> billion or more $1 million - $9.9 million $1 billion - $9.9 billion Less than $1 million $<strong>10</strong>0 million - $999 million Don’t know $<strong>10</strong> million - $99.9 millionUpToF. Do you recommend, specify, evaluate, approve or purchasemainframe products or services for your organization?01 Yes 02 NoG. Which <strong>of</strong> the following products, services, and/or technologiesdo you currently approve, specify or recommend the purchase <strong>of</strong>? Application Servers Web Servers Server Side Hardware Client Side Hardware Wireless Device Hardware Databases Java IDEs Class Libraries S<strong>of</strong>tware Testing Tools Web Testing Tools Modeling Tools Team Development Tools Installation Tools Frameworks Database Access Tools / JDBC Devices Application Integration Tools Enterprise Development Tool Suites Messaging Tools Reporting Tools Debugging Tools Virtual Machines Wireless Development Tools XML Tools Web Services Development Toolkits Pr<strong>of</strong>essional Training Services Other [Please Specify]________________________________<strong>SYS</strong>-<strong>CON</strong> Events, Inc, and <strong>SYS</strong>-Con <strong>Media</strong> make no warrantiesregarding <strong>con</strong>tent, speakers or attendance. The opinions <strong>of</strong> speakers,exhibitors and sponsors do not reflect the opinion <strong>of</strong> <strong>SYS</strong>-<strong>CON</strong> Eventsand <strong>SYS</strong>-<strong>CON</strong> <strong>Media</strong> and no endorsement <strong>of</strong> speakers, exhibitingcompanies products, or sponsors is implied.If you require special assistance coveredunder the Americans with Disabilities Act,please call 201-802-3066 byFebruary 4, 2005.CANCELLATIONS,SUBSTITUTIONS, REFUNDSFax written request to <strong>SYS</strong>-<strong>CON</strong> Registration201-782-9601. Requests for refunds receivedprior to January 7, 2005 will be honored, lessa <strong>10</strong>% handling charge; requests receivedafter January 7, 2005, and before February 4,2005, will be honored less a 20% handlingcharge. No requests for refunds will behonored after February 4, 2005. Requests forsubstitutions must be made in writing prior toFebruary 11, 2005. No one under 18 ispermitted to attend. No warranties are maderegarding the <strong>con</strong>tent <strong>of</strong> sessions or materials.Speakers, sessions and schedule are subject tochange without prior notice.No solicitation by anyone other than<strong>of</strong>ficial exhibitors, sponsors or marketingpartners is permitted. Such behavior iscause for expulsion without refund.


@ the BackpageLazy Programmers CanMake Cache Todayby Warren MacEvoyWarren D. MacEvoy is anassistant pr<strong>of</strong>essor <strong>of</strong>computer science in thedepartment <strong>of</strong> computerscience, mathematics, andstatistics at Mesa StateCollege, Grand Junction,Colorado.wmacevoy@mesastate.eduLet me begin with a philosophicalrant. There is a motto fromscientific computing that carriesover to many areas <strong>of</strong> computerscience:The gains made by better algorithmsalmost always outstrip the gains frombetter hardware.I’ve frequently seen where algorithmimprovements pay by factors <strong>of</strong> ten totens <strong>of</strong> thousands in CPU time. Onechange I made in a numerical algorithmimproved CPU requirements by afactor <strong>of</strong> 50,000: from weeks on a supercomputer to minutes on a workstation.Any business-savvy engineer knowsthat algorithm improvements come ata price: the engineer’s time. Strikingthat balance makes s<strong>of</strong>tware <strong>sys</strong>temsmove forward rather than stagger to ahalt in bloat and dysfunction. It alsohelps to use people who actually knowwhat they are doing – knowing how tocompile code doesn’t make you a s<strong>of</strong>twareengineer any more than knowinghow to spell makes you a writer. End <strong>of</strong>rant.On to (rant-related) business. Onmost Web sites, think <strong>of</strong> how manytimes a data source will be used toretrieve the same data and producethe same <strong>con</strong>tent over and over again.Most successful services deliver a highlyredundant amount <strong>of</strong> information totheir users. For example, the <strong>JDJ</strong> Website will deliver this (same) <strong>con</strong>tent toperhaps a hundred thousand users. Ifthe servers are overtaxed, customerswill experience significant delays ormalfunctions.There are several useful solutionsto this. Well-<strong>con</strong>figured caching proxyservers come to mind, although serversidescripting makes this difficult. Buyingmore hardware will eventually fixthe problem, which may be the correctbusiness solution.But what about asking programmersto be a little more lazy?The source for the LazyFileOutput-Stream can be downloaded from http://bpp.sourceforge.net/download/bpp-0.8.5b/src/bpp/LazyFileOutputStream.java. It acts just like a regular FileOutputStreamexcept that if created on afile that already exists, it “reads” the datafrom the file instead <strong>of</strong> writing it. Thestream compares what is already in thefile with what you are currently writingto it. If at any point it sees that there isa difference in the data you are writingthis time compared to what is alreadythere, the stream automatically switchesto a write mode that writes over theremainder <strong>of</strong> the file with the changes.The upshot is, if your programgenerates the same output twice, theoutput file is unmodified the se<strong>con</strong>dtime (leaving the original modificationdate). First, by simply changingFileOutputStream to LazyFileOutput-Stream, any downstream processingcan use timestamp information onthe files to check if they need to doanything at all. If the timestamp hasn’tchanged, neither have the <strong>con</strong>tents.But wait, there’s more! In addition tothe standard close(), the LazyFileOutputStreamalso supports abort(). Thismethod effectively states “I’m donenow, leave the rest <strong>of</strong> the file alone.” Theremainder <strong>of</strong> the file will be the same,even without reproducing it. This meansthat if you determine at an early point inthe processing <strong>of</strong> the file that it’s goingto turn out the same, you can simplyabort() to leave it alone. It’s similar tothe idea <strong>of</strong> not changing the modificationdates on files that are rewritten withthe same data, but allows you to saveCPU time for the current process step aswell as downstream processing.Certain engines produce part <strong>of</strong> thetemplate before you can <strong>con</strong>venientlyintervene to decide if you really need toregenerate it. By opening up the outputas a Lazy file, you can just abort()early and have the old version with thethe old modification time around fordownstream processing.Okay, rant <strong>con</strong>cluded and pointmade: CPUs around the planet arespinning through the same data tens<strong>of</strong> thousands <strong>of</strong> times, producingthe same <strong>con</strong>tent tens <strong>of</strong> thousands<strong>of</strong> times. Instead <strong>of</strong> buying great bigservers to manage this, a smart cachingpolicy based on lazy file writers andsome modification time testing couldsave some sites that same wild-soundingfactor <strong>of</strong> 50,000, without having tobuy 50,000 new servers.Anecdote #1There is a certain technical advantageto this style <strong>of</strong> writing data aswell: most storage devices are easierto read from than write to, adheringto the 80/20 rule – 80% <strong>of</strong> file accesswill be reads, 20% will be writes. TheLazyFileOutputStream takes advantage<strong>of</strong> that for the many files thatare simply rewritten with the same<strong>con</strong>tent.Anecdote #2There must be a few curled toes outthere saying to themselves, “Why notLazyFileWriter?” There are good technicalreasons for the OutputStream:the logic <strong>of</strong> the data written must bechecked in its raw “byte” format forthe idea to work correctly, and you canalways wrap this in an OutputStream-Writer followed by a BufferedWriter,which is what I recommend.Now I’m even done with the anecdotes.Have a nice day.62 January 2005www.<strong>SYS</strong>-<strong>CON</strong>.com/<strong>JDJ</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!