SPECIAL INSERT: WEB SERVICES EDGE CONFERENCE & EXPO pg. 59

www.JavaDevelopersJournal.com

Web Services Edge West 2003

Sept. 30–Oct. 2, 2003 Santa Clara, CA 6 page insert on pg. 59

From the Editor Everything’s a $1 Alan Williamson pg. 5

Viewpoint Unleashing Tiger Java Architecture: Understanding the Java Rohit Chaudhri Kirk Pepperdine pg. 6 Classloading Mechanism Extend the Java platform 10 J2EE Insight Chaos and Order Feature: ActiveAuthentication Thomas Beck Joseph Ottinger pg. 8 Extending J2EE form-based authentication 18

J2SE Insight Forum: Java Games Development Jason R. Briggs JavaOne Let the games begin – a discussion on Java games 28 Jason Bell pg. 26

E. Skoglund, J2ME Insight Feature: Practical Integration of Java-Oriented Sun Addled Technologies and 2.5/3G Platforms A. McIntyre, B. Hartlen, & M. Erickson Glen Cordrey pg. 46 Challenges for the wireless developer 48

Industry News Show Report: The Spring 2003 Rocky Mountain Tom Marrs pg. 55 Software Symposium ‘No Fluff, Just Stuff’ 54

RETAILERS PLEASE DISPLAY UNTIL OCTOBER 31, 2003 Labs: Caché 5 by InterSystems Corporation – M. Kühn & C. Och a development framework for object-oriented programmers 56

JSR Watch: From Within the Java Community Onno Kluyt Process Program A more open and transparent process 58 From the Inside: Twenty-First Century SYS -CON MEDIA Snake Oil Salesmen Same scam, different scenario 66 WE’VE ELIMINATED THE NEED FOR MONOLITHIC BROKERS. THE NEED FOR CENTRALIZED PROCESS HUBS. THE NEED FOR PROPRIETARY TOOL SETS.

Introducing the integration technology YOU WANT.

Introducing the Sonic Business Integration Suite. Built on the Business Integration Suite world’s first enterprise service bus (ESB), a standards-based infrastructure that reliably and cost-effectively connects appli- cations and orchestrates business processes across the extended enterprise. Extend your reach, cut costs and enhance

your business agility. Thus eliminating one more thing – Connect_Everything. your headaches. To learn more,visit www.sonicsoftware.com. Achieve_Anything.ª Why do industry leaders choose Zero G?

Because, Zero G is the industry leader in multi-platform software deploy-

ment and updating. But, it didn't just happen overnight. Since 1996 we have

listened, adapted, and built our award-winning InstallAnywhere® and

PowerUpdate® products based on constant interaction with our customer-

partners,That’s why they have become the developers’deployment solution

of choice worldwide. It’s no wonder that industry leaders like Sun

Microsystems, and Borland choose us.

Your software deployment partner www.ZeroG.com

© 2003 Zero G Software, Inc. Zero G, Zero G Software, and InstallAnywhere are trademarks or registered trademarks of Zero G Software, Inc. All other trademarks are property of their respective owners. BEA Users Get Oracle For Free

Free Oracle9iAS Java licenses For 1/2 your current BEA Java support fee For details, call 1.800.633.0538

For important conditions, limitations, oracle.com/switch and restrictions call 1.800.633.0538

Copyright © 2003, Oracle. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. FROM THE EDITOR

International Advisory Board Calvin Austin (Sun) J2ME Jason Bell (Independent) Jason Briggs (Independent) Alan Williamson Jeremy Geelan (SYS-CON) Rickard Öberg (Independent) Editor-in-Chief Joe Ottinger (Independent) Bill Roth (Sun) Ajit Sagar (Independent) Eric Stahl (BEA) Jon Stevens (Apache) Aaron Williams (JCP) Alan Williamson (SYS-CON) J2SE Joe Winchester (IBM) Everything’s a $1 Blair Wyman (IBM) Editorial Editor-in-Chief: Alan Williamson Editorial Director: Jeremy Geelan Executive Editor: Nancy Valentine t has been a very busy month. $27 million in revenue. J2EE Editor: Joe Ottinger SYS-CON Media recently began There is no such thing as free in J2ME Editor: Glen Cordrey its complete overhaul of the legal terms. A contract always has to be J2SE Editor: Jason Bell Contributing Editor: Jason R. Briggs LinuxWorld.com Web site, which worth at least something and the usual Contributing Editor: Ajit Sagar we now publish as the online amount is $1. Why? Probably because J2EE Founding Editor: Sean Rhody I counterpart to LinuxWorld it’s not of any monetary significance Production Magazine, which we’re launching this for anyone to complain. I would be Production Consultant: Jim Morgan month at LinuxWorld in San Francisco. more than happy to pay the “nominal” Associate Art Director: Louis F. Cuffari Associate Editors: Jamie Matusow With this overhaul came all the logis- amount and put back into the system Gail Schultz tics of moving and hosting the Web site for the original developers’ efforts. Jean Cassidy

Jennifer Van Winckel – LinuxWorld.com having been previ- But the term “free software” or H Online Editor: Lin Goetz ously run by International Data Group “freeware/shareware” doesn’t seem to OME Technical Editor: Bahadir Karuv, Ph.d. (IDG). Naturally we went with a - be a sexy enough title. It’s been around Writers in This Issue based infrastructure as it would have for years but still has a stigma attached Thomas Beck, Jason Bell, Paul Bemowski, been sacrilegious to do anything else! to it. It doesn’t capture the hearts and Jason R. Briggs, Rohit Chaudhri, Glen Cordrey, Marc R. Erickson, Bryan Hartlen, Onno Kluyt, This was your classic open source minds of the masses like the term Angus McIntyre, Joseph Ottinger, Kirk Pepperdine, solution; no software licenses to pay “open source” does. Free software Eva Skoglund, Alan Williamson and the download was quick and pain- seems to have a perceived notion that

To submit a proposal for an article, go to less. The term “open source” doesn’t sit it’s of inferior quality to its commercial http://grids.sys-con.com/proposal too well with me though; I think it counterparts. As we all know, nothing Subscriptions needs to be called what it is. I don’t feel could be further from the truth. The For subscriptions and requests for bulk orders, please send your comfortable using it – let me explain. list price for a particular piece of soft- letters to Subscription Department [email protected]. Cover Price: $5.99/issue. Domestic: $69.99/yr. (12 Issues) When I downloaded and installed ware in no way guarantees its quality. Canada/Mexico: $99.99/yr. Overseas: $99.99/yr. (U.S. Banks or Apache I didn’t need the source code. Open source is too misleading. The Money Orders) Back Issues: $10/ea. International $15/ea. When I ran up the server and config- romantic notion of finding a bug, fix- Editorial Offices ured it, I didn’t need the source code. ing it yourself, applying it back into the SYS-CON Media, 135 Chestnut Ridge Rd., Montvale, NJ 07645 Telephone: 201 802-3000 Fax: 201 782-9600 When I read the documentation on main build for the benefit of the larger how to configure some of the more community is so far from the truth that Java Developer’s Journal (ISSN#1087-6944) is published monthly (12 times a year) for $69.99 by SYS-CON Publications, Inc., 135 advanced options, again, I didn’t need it’s laughable. Open source projects Chestnut Ridge Road, Montvale, NJ 07645. Periodicals postage to refer to the source code. (the successful ones) are very closely rates are paid at Montvale, NJ 07645 and additional mailing offices. Postmaster: Send address changes to: Java Developer’s For us and the vast number of sites controlled with only a handful of des- Journal, SYS-CON Publications, Inc., 135 Chestnut Ridge Road, Montvale, NJ 07645. running Apache (nearly 27 million ignated people allowed to commit according to NetCraft, July 2003), the changes. But this is one of the reasons ©Copyright fact that Apache’s source code is avail- they are successful; the software is kept Copyright © 2003 by SYS-CON Publications, Inc. All rights reserved. No part of this publication may be reproduced or able doesn’t matter to us. We are nei- under tight control and not allowed to transmitted in any form or by any means, electronic or mechan- ical, including photocopy or any information storage and ther skilled nor have the time to actu- morph out of hand. retrieval system, without written permission. For promotional ally look at it properly. For us, it’s free But the term “free” doesn’t work Alan Williamson, when not reprints, contact reprint coordinator Carrie Gebert, carrieg@sys- con.com. SYS-CON Media and SYS-CON Publications, Inc., software. I could paint the same story either. Moving back to the model of $1- answering your e-mails and reserve the right to revise, republish and authorize its readers to use the articles submitted for publication. using MySQL, JEdit, Eclipse, or Ant. per-download, we could give it another working on the next issue of JDJ, Are you choosing (insert your free name and call it “nominal licensing.” heads up a small team dubbed Worldwide Newsstand Distrubution product of choice) because it’s free or Needs to be catchier than that I fear! the “Thunderbirds of the Java Curtis Circulation Company, New Milford, NJ because it’s open source? I hope you’re But it would lift us away from the “free- industry,” providing on- and off- Java and Java-based marks are trademarks or registered choosing it because it’s good and the ware” stigma and be friendlier than site rescue for Java projects in trademarks of Sun Microsystems, Inc., in the United States and other countries. SYS-CON Publications, Inc., is independent of best tool for the job. But what if they open source. trouble. For more information Sun Microsystems, Inc. All brand and product names used on decided to start charging for it tomor- We are moving toward a freer visit www.javaSOS.com. these pages are trade names, service marks or trademarks of their respective companies. row. Would you pay for it? Would a choice of tools/software, allowing us to You can also read his blog: nominal charge be acceptable? For choose based on functionality and per- http://alan.blog-city.com. example, would $1 per installation be formance as opposed to which one has too much? For Apache that could be the cheapest price tag. [email protected] www.JavaDevelopersJournal.com August 2003 5 VIEWPOINT

President and CEO: Unleashing Fuat A. Kircaali [email protected] Vice President, Business Development: Grisha Davida [email protected]

Tiger Kirk Pepperdine Advertising Senior Vice President, Sales and Marketing: Carmen Gonzalez [email protected] p till now, changes to Java have been passing it along? If mixing objects and Vice President, Sales and Marketing: pretty much constrained to APIs and primitives is the problem, it seems rea- Miles Silverman [email protected] the inner workings of the Java 2 plat- sonable to suggest that we shouldn’t Advertising Sales Director: Robyn Forma [email protected] form. All of this will change once the mix them. Instead, let’s promote primi- J2SE Director, Sales and Marketing: JDK 1.5 has been released. The extent tives to the status of first class objects Megan Ring [email protected] Uof these changes was revealed in a with all the rights and privileges. In Adverting Sales Manager: recent interview with Joshua Bloch doing so, we would eliminate the need Alisa Catalano [email protected] (http://java.sun.com/features/ for wrapper classes and, consequently, Associate Sales Managers: 2003/05/bloch_qa.html). As illuminat- for autoboxing. Carrie Gebert [email protected] Kristin Kuhnle [email protected] ing as the interview was, it left me In the past when I suggested that with a number of questions, so I start- primitives should be promoted, I was Editorial ed to search for answers by reading told that this would be incredibly inef- Executive Editor: J2EEJSR 201. J2ME ficient. My counter to this argument Nancy Valentine [email protected] If you read this JSR, you’ll find that focuses on two points. First, being a Associate Editors: Jamie Matusow [email protected] it doesn’t include a critical discussion first class object is a syntactic or nota- Gail Schultz [email protected] of the proposed changes, nor is there tional convenience. The final compiled Jean Cassidy [email protected] any supporting documentation that representation of integers and other Jennifer Van Winckel [email protected] includes a record of such a discussion. primitives could (and should) be the Online Editor: In fact, I was unable to find a public choice of the implementers (sound Lin Goetz [email protected] record of any critical discussion. Surely familiar?). The second point was really

OME Production those discussions took place. What in response to the comments about the Production Consultant: H alternatives were proposed and why differences in efficiency between oper- Jim Morgan [email protected] were they ultimately rejected? Do the ating on primitive types and on Lead Designer: proposed changes represent a direc- objects. But what of these differences? Louis F. Cuffari [email protected] tion for the evolution of the language? Do we really have to experience the Art Director: Alex Botero [email protected] Take autoboxing, for instance. What cost of method lookups for each oper- Associate Art Director: problem is it trying to solve and is ation? To this I reply: Java is a typed Richard Silverberg [email protected] there an alternative that offers a better language. In other words, we are giving Assistant Art Director: solution? Here are some thoughts on the compiler big hints as to what we Tami Beatty [email protected] this point. are doing. The compiler should be able Web Services Autoboxing is a concise notation for to use these hints to do the right thing. Vice President, Information Systems: working with instances of the In fact, current compiler optimizations Robert Diamond [email protected] immutable classes that are used to are the result of far more complicated Web Designers: wrap primitive types. It will allow us to evaluations. One last point: autoboxing Stephen Kilmurray [email protected] Christopher Croce [email protected] replace code such as “new Integer( is implicitly creating both new objects ((Integer)map.get(key)).getInt() + 1)” and garbage. Though this is not bad in Accounting with “map.get(key) + 1”. While this itself, it does remind me of the per- Accounts Receivable: code is easier on the eye, does this new formance problems that can result Kerri Von Achen [email protected] syntax tackle the fundamental issue from using + to simplistically concate- Financial Analyst: Joan LaRose [email protected] that objects and primitive types are nate strings. Accounts Payable: like water and oil? They don’t mix I first thought of offering a coun- Betty White [email protected] unless you add an emulsifier. In Java, terargument to my proposal, but then the emulsifying agents have been realized that it’s not my role to do so; SYS-CON Events wrapper classes, one for each primitive it’s yours. Furthermore, shouldn’t it be President, SYS-CON Events: Grisha Davida [email protected] type. As necessary as these wrapper the role of the JCP to foster healthy Conference Manager: classes are, they do hinder our ability debates on all of its proposals so that Michael Lynch [email protected] to operate on the underlying primitive we, as a community, know and under- Sales Executive, Exhibits: Kirk Pepperdine is the chief techni- unless we resort to the unpleasant- stand that we are getting the best James Donovan [email protected] cal officer at Java Performance looking code listed above. Instead of choices possible? After all, we, the Tuning.com and has been focused solving the problem, wrapper classes average Java developers, are the ones Customer Relations Circulation Service Coordinators: on object technologies and per- have seemingly shifted the problem who sit in the trenches of the Java Niki Panagopoulos [email protected] formance tuning for the last 15 elsewhere, which resulted in the JCP community, and the JCP can only be Shelia Dickerson [email protected] years. Kirk is a co-author of Ant Expert Group recommending that our process if we all become more Edna Earle Russell [email protected] Developer’s Handbook (Sams). autoboxing be added to the language. involved in it. You can send your com- JDJ Store Manager: This begs the question: Couldn’t we ments to the JSR 201 and JSR 215 Rachel McGouran [email protected] [email protected] have solved the problem instead of Expert Groups.

6 August 2003 www.JavaDevelopersJournal.com Copyright © 2002 Canoo Engineering AG. All Rights Reserved. Java and all Java-based trademarks are registered trademarks of Sun Microsystems, Inc. ■ ■ ■ ■ ■ ■ ■ ■ ■ made easy made clients thin Java with full GUI capability GUI full with Web integration (applet, Java Web(applet, Start) Webintegration container) (Web/EJB integration J2EE seamless communication low-bandwidth for optimized client on engine display generic and lean only server on deployment application operation and deployment easy code source incl. set widget Swing-based extensible server and client between split transparently widgets server-sidedevelopmentJavapure mix: technology no split code client-server about worries no development easy U ltra L ight C lient

wteln [email protected] http://www.canoo.com/ulc/ Switzerland Basel CH-4051 49 94 228 61 +41 Fax 7 Kirschgartenstrasse 44 94 228 61 +41 Tel AG Engineering Canoo Download your free trial today! trial freeyour Download

out now! out Release 5.1 Release NEW! J2EE INSIGHT

J2ME Joseph Ottinger J2EE Editor Chaos and Order J2SE

haos. Anthropomorphically speaking, fying it to comply with what the indus- it wants to go everywhere. try requires. The open software authors Order. It wants to be everywhere likewise need to understand that stan- too, and is willing to fight chaos to do dards exist for a reason, that there’s a it. benefit to them. That’s already some- Active C Michael Moorcock used to write what in place – remember when there lots of fundamentally depressing books used to be shouting matches over Authentication J2EE about this very idea, and you can see it where to place brackets? You still have 18 everywhere today – politically speak- that every now and then, but there’s a ing, in the U.S. You have order being common standard that’s dominating imposed as much as is possible on a now, so the fights over code format are culture that tends to thrive on chaos; sporadic and short. That sort of sce- Chaos and Order more relevant to this magazine, you nario can play itself out in how code Innovative solutions have industry standards trying to make works, too, just like it has played out in tend to come initially from the OME

H sure that everyone marches in straight how code is formatted. chaotic underground, and tested 8 lines, while rogue coders (so to speak!) Of course, if everyone decides to solutions tend to grow out of the spend time writing marvelous, new only play by the rules, then creativity orderly standards bodies taking code underground. is stifled. I’d rather this not happen, the new solution and rigorously Both sides are good; innovative obviously. It’s important to see new solutions tend to come initially from ways of doing things, even if only so smacking it about until it’s able the chaotic underground, and tested they can be rejected. Consider object to handle a real load. The con- solutions tend to grow out of the , which are excellent solu- cept comes from beneath, and orderly standards bodies taking the tions for some vertical applications; the validity of the concept nearly new solution and rigorously smacking when your domain is limited to those always comes from the office. it about until it’s able to handle real applications and your assumptions load. The concept comes from can be applied, they’re great! (Look at beneath, and the validity of the con- Prevayler and its claims of incredible cept nearly always comes from the speed.) However, the assumptions can Understanding office. be nasty; object databases can be crip- the Java Classloading Unfortunately, both sides tend to pling if you need to process the data Mechanism view the other with suspicion. The from a language that doesn’t represent The Java platform 10 ones who chant “standards! stan- objects the same way. (Consider a was designed to be robust, dards!” are corporate stooges, to the COBOL program trying to modify a secure, and extensible in order bazaar-based bunch; likewise, the Prevayler dataset. It can be done, to be to support the mobility of code madding crowd is viewed as a set of sure…but let’s just say that most peo- subversive, rogue elements by those ple would rather gnaw off their own and data. The Java ClassLoader wearing ties. Neither group trusts the neck first.) in the Java Virtual Machine (JVM) other, and often both groups insist that Yet, it’s still important to have these is a key component in the real- the opposition isn’t necessary. tools. You’ll certainly find solutions ization of these goals. This arti- It’s important for us to remember that are vertical enough to use these cle presents the Java ClassLoader Joseph Ottinger is a consultant that chaos exists within the framework products well and provide a reason for architecture and discusses the with Fusion Alliance of order, or else we can’t recognize their existence. Who knows, maybe implications of ClassLoaders on (www.fusionalliance.com) and is what it is – likewise, order stifles cre- their authors or users will find a way to a frequent contributor to open ativity and we need creativity right bridge the conceptual divide and make platform security and extensibili- source projects in a number of now. the products more generically useful ty as well as a method to imple- capacities. Joe is also the acting This can be applied by using soft- and take over, but the “generically use- ment user-defined ClassLoaders. chairman of the JDJ Editorial ware and participating in the process. ful” aspect will almost always come Advisory Board. For us, that means that people who from larger, organized bodies imposing understand the standards would bene- a structure over what the products do [email protected] fit from using open software and modi- and how.

8 August 2003 www.JavaDevelopersJournal.com JAVA ARCHITECTURE Understanding the Java J2ME Classloading Mechanism Rohit Chaudhri Extend the Java platform

he Java platform was designed to be ing, i.e., loading classes only when current ClassLoader will then try to J2SE robust, secure, and extensible in order required, so at start-up the JVM doesn’t search for the requested class. Each to support the mobility of code and need to know the classes that would get ClassLoader has defined locations data. The Java ClassLoader in the Java loaded during runtime. Lazy loading where it searches for classes to load. Virtual Machine (JVM) is a key compo- plays a key role in providing dynamic For instance, the bootstrap T nent in the realization of these goals. extensibility to the Java platform. The ClassLoader searches in the locations The JVM is responsible for loading Java runtime can be customized in (directories and zip/jar files) speci- and executing code on the Java plat- interesting ways by implementing a fied in the sun.boot.class.path sys- form. It uses a ClassLoader to load Java custom ClassLoader in a program, as tem property. The system classes into the Java runtime environ- I’ll discuss later. ClassLoader searches for classes in J2EE ment. ClassLoaders are architected so the locations specified by the class- that at start-up the JVM doesn’t need to Java 2 ClassLoader Delegation Model path (set as the java.class.path sys- know anything about the classes that Multiple instances of ClassLoaders tem property) command-line vari- will be loaded at runtime. Almost all exist in the Java 2 runtime, each load- able passed in when a JVM starts Java-based containers such as EJB or ing classes from different code reposi- executing. If the class is found, it’s servlet containers implement custom tories. For instance, Java core API class- loaded into the system and returned, ClassLoaders to support features like es are loaded by the bootstrap (or pri- completing the request. OME

H hot deployment and runtime platform mordial) ClassLoader. Application-spe- 4. If the class is not found, a extensibility. An in-depth understand- cific classes are loaded by the system java.lang.ClassNotFoundException is ing of ClassLoaders is important for (or application) ClassLoader. In addi- thrown. developers when implementing such tion, an application can define its own Java-based containers. ClassLoaders to load code from custom Implementing a Java 2 For enterprise developers who repositories. Java 2 defines a parent- Custom ClassLoader develop components that are deployed child relationship between As mentioned earlier the Java plat- on these containers, this knowledge ClassLoaders. Each ClassLoader except form allows an application program- will help you understand how the con- the bootstrap ClassLoader has a parent mer to customize the classloading tainer works and with debugging prob- ClassLoader, conceptually forming a behavior by implementing a custom lems. This article presents the Java treelike structure of ClassLoaders. The ClassLoader. This section shows how. ClassLoader architecture and discusses bootstrap ClassLoader is the root of this ClassLoaders (all but the bootstrap the implications of ClassLoaders on tree and thus doesn’t have a parent. The ClassLoader, which is implemented in platform security and extensibility as relationship is depicted in Figure 1. native code in the JVM) are implement- well as a method to implement user- The following is a high-level class- ed by extending the java.lang.Class defined ClassLoaders. loading algorithm executed by a Loader class. The following code shows The smallest unit of execution that ClassLoader when a client requests it to the relevant methods of the Java 2 gets loaded by a ClassLoader is the Java load a class: ClassLoader API: class file. A class file contains the bina- 1. A check is performed to see if the ry representation of a Java class, which requested class has already been 1. public abstract class ClassLoader extends Object { has the executable bytecodes and refer- loaded by the current ClassLoader. If 2. protected ClassLoader(ClassLoader parent); ences to other classes used by that so, the loaded class is returned and 3. protected final Class defineClass( class, including references to classes in the request is completed. The JVM 4. String name,byte[] b,int off,int len) the Java API. Stated simply, a caches all the classes that are loaded 5. throws ClassFormatError ClassLoader locates the bytecodes for a by a ClassLoader. A class that has 5. protected Class findClass(String Java class that needs to be loaded, previously been loaded by a 7. className) throws ClassNotFoundException reads the bytecodes, and creates an ClassLoader is not loaded again. 6. public class loadClass(String className) instance of the java.lang.Class class. 2. If the class is not already loaded, the 7. throws ClassNotFoundException This makes the class available to the request is delegated to the parent 8.} JVM for execution. Initially when a JVM ClassLoader, before the current starts up, nothing is loaded into it. The ClassLoader tries to load it. This del- Each ClassLoader is assigned a par- class file of the program being executed egation can go all the way up to the ent when it’s created, as per the parent- is loaded first and then other classes bootstrap ClassLoader, after which delegation model. Clients invoke the and interfaces are loaded as they get no further delegation is possible. loadClass method on an instance of a referenced in the bytecode being exe- 3. If a parent fails to return a class ClassLoader to load a class. This initi- cuted. The JVM thus exhibits lazy load- because it was unable to load it, the ates the classloading algorithm as

10 August 2003 www.JavaDevelopersJournal.com ® ® Borland JBuilder Ten things you didn’t know about the #1 IDE for Java™

1) Deep integration with BEA, Borland, IBM, Oracle, SunOne, Sybase, and Tomcat application servers 2) JBuilder® Developer Edition for hard-core developers 3) Award-winning Borland® Optimizeit™ Suite now included 4) Import project source from any IDE or editor 5) State-of-the-art refactoring capabilities 6) Fully integrated Apache™ ANT build capabilities and JUnit testing 7) Advanced flexible code formatting and Borland® ErrorInsight™ 8) New developers quickly productive with advanced tools and wizards 9) Dynamic web support using struts, servlets, JavaServer Pages, XML, and Web Services 10) Standards compliance to deploy your code anywhere

Borland® JBuilder® makes the fast faster because it works the way you work. It knows what you need to do next, no matter what your style. JBuilder gives you an active voice at every stage in the development process and is the devel- oper’s access point into the Borland Application Lifecycle solution — best-in-class products integrated to help the whole development team make better software, faster. JBuilder, the #1 development environment for building any type of Java application: Web, Enterprise, Mobile, and Web Services.

Visit go.borland.com/j6

Learn from the experts at the premier event for technical education — the 2003 Borland Conference. Learn more: www.borland.com/conf2003s Made in Borland® Copyright © 2003 Borland Software Corporation. All rights reserved. All Borland brand and product names are trademarks or registered trademarks of Borland Software Corporation in the United States and other countries. Microsoft, Windows, and other Microsoft product names are trademarks or registered trademarks of Microsoft Corporation in the U.S. and other countries. All other marks are the property of their respective owners. • 20729.3

DEFINE DESIGN DEVELOP TEST DEPLOY MANAGE Borland® CaliberRM™ Borland® Together® Borland JBuilder Borland Optimizeit Suite Borland® Enterprise Server, Borland® StarTeam® ControlCenter® AppServer™ Edition JAVA ARCHITECTURE

explained earlier. Prior to Java 2, the Deviations from the Java 2 4. System.out.println("waiting.Hit loadClass method in the Delegation Model 5. Enter to continue"); java.lang.ClassLoader class was The Java 2 delegation model cannot 6. System.in.read(); declared abstract, requiring custom be followed in all situations. There are 7. customLoader = new CustomClassLoader ClassLoaders to implement it when cases in which ClassLoaders have to 8. (repository);

J2ME extending the java.lang.ClassLoader diverge from the Java 2 model. For 9. loadAndInvoke(customLoader,classToLoad); class. Implementing the loadClass instance, the servlet specification rec- method is rather complicated, so this ommends (section 9.7) that a Web appli- An instance of the CustomClass has been changed in Java 2. With the cation ClassLoader be implemented so Loader is created to load classes from a introduction of the ClassLoader parent that classes and resources packaged in repository specified as a command-line delegation model, java.lang.Class the Web application archive are loaded parameter. loadAndInvoke loads a class, Loader has an implementation of the in preference to classes and resources HelloWorld, also specified as a com- loadClass method, which is essentially residing in container-wide JAR files. To mand-line parameter, and invokes a J2SE a template method that executes the meet this recommendation, a Web method on its instance, which prints a classloading algorithm. The loadClass application ClassLoader should search message on the console. While the pro- method invokes the findClass method for classes and resources in its local gram is waiting for user input at line 6, (introduced in Java 2) in Step 3 of the repository first, before delegating to a the HelloWorld class can be changed (by classloading algorithm. Custom parent ClassLoader, thus deviating from changing the message that gets printed ClassLoaders should override this the Java 2 delegation model. This rec- on the console) and recompiled. When method to provide a custom way of ommendation makes it possible for Web the program continues execution, a new locating and loading a Java class. This applications to use different versions of instance of CustomClassLoader is creat- greatly simplifies the implementation classes/resources than those being used ed at line 7. When loadAndInvoke exe- J2EE of a custom ClassLoader. Listing 1 by a servlet container. For example, a cutes line 9, it loads the updated version shows some code from the Web application might be implemented of HelloWorld and a new message is CustomClassLoader.java class (the using features available in a newer ver- printed on the console. complete source code can be down- sion of an XML parser than the one loaded from www.sys- being used by a servlet container. Modifying Class Files con.com/java/sourcec.cfm), which A Web application ClassLoader that A ClassLoader searches for byte- loads classes from a repository speci- meets the recommendation of the codes of a class file in the findClass OME

H fied in the constructor. servlet specifications can be imple- method. After the bytecodes have been The findClass method invokes mented by overriding the loadClass located and read into the program, they loadFromCustomRepository that method of the java.lang.Classloader may be modified before invoking searches for the given class in the class. The loadClass method of such a defineClass. For example, extra debug- repository and, if custom ClassLoader may look similar ging information may be added to the found, reads and to Listing 2. class file before invoking defineClass. returns the byte- Class file data for some secure applica- codes for the class. Applications of ClassLoaders tions may be stored encrypted in a The raw bytecodes ClassLoaders provide some power- repository; the findClass method can for the class are ful features that can be utilized in Java decrypt the data before invoking passed into the programs. This section discusses a few defineClass. A program can generate defineClass method ways in which they can be used. the bytecodes on the fly instead of implemented in the retrieving them from a repository. This java.lang.Class Hot Deployment forms the basis of JSP technology. Loader class, which Upgrading software in a running returns an instance application without restarting it is ClassLoaders and Security of the java.lang.Class known as hot deployment. For a Java Since a ClassLoader is responsible for object. This makes a application, hot deployment means bringing code into the JVM, it’s archi- new class available upgrading Java classes at runtime. tected so that the security of the plat- to a running Java ClassLoaders play an important role in form may not be compromised. Each program. The Java-based application servers to ClassLoader defines a separate name- defineClass method achieve hot deployment. This feature is space for the classes loaded by it, so at Figure 1 The parent delegation model also ensures that a exploited in most Java-based applica- runtime a class is uniquely identified by custom ClassLoader tion servers like EJB servers and servlet its package name and the ClassLoader does not redefine core Java API classes containers. A ClassLoader cannot that loaded it. A class is not visible out- by loading them from a custom reposi- reload a class that it has already loaded, side its namespace; at runtime there’s a Rohit Chaudhri is a member of the tory. A SecurityException is thrown if but using a new instance of a protective shield between classes exist- mobile platforms and services lab at the class name passed to defineClass ClassLoader will reload a class into a ing in separate namespaces. The parent Motorola. The team investigates end- begins with “java”. running program. The following code delegation model makes it possible for a to-end application platforms for the It should be noted that at start-up, from TestCustomLoader.java illustrates ClassLoader to request classes loaded by wireless Internet. He has an MS in the JVM doesn’t need to know anything how hot deployment may be achieved its parent, thus a ClassLoader doesn’t computer science and is a Sun about the class represented by the in a Java application: need to load all classes required by it. Certified Programmer for the Java 2 string passed into the loadClass The various ClassLoaders that exist Platform. method. A subsequent section shows 1. ClassLoader customLoader = new in a Java runtime have different reposi- how a program can use the 2. CustomClassLoader(repository); tories from which they load code. The [email protected] CustomClassLoader. 3. loadAndInvoke(customLoader,classToLoad); idea behind separating repository loca-

12 August 2003 www.JavaDevelopersJournal.com The only Java components you need for J2EE or Swing development

JClass® Rich client user interface and utility components. Server-side web client interface and reporting components. Whatever type of Java development you’re doing, JClass can help.

JClass ServerViews Add professional content to your Servlet, JSP or J2EE applications. Generate interactive charts with JClass ServerChart and dynamic PDF reports with JClass ServerReport. Now fully XML and Web Services ready!

JClass DesktopViews Essential components for client-side Java applications and applets: 2D/3D charts, tables/grids, data-entry fields, access and much more.

Evaluate and experience JClass today - visit: http://java.quest.com/jclass/jdj

© 2003 Quest Software, Inc. Quest, Sitraka and JClass are trademarks or registered trademarks of Quest Software, Inc. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All other products are trademarks or registered trademarks of their respective companies. JAVA ARCHITECTURE

tions is that different trust levels can be ClassLoader should extend the Summary assigned to the repositories. The Java java.security.SecureClassLoader class ClassLoaders offer a powerful runtime libraries loaded by the boot- and invoke its defineClass method that mechanism by which the Java platform strap ClassLoader have the highest level takes a java.security.CodeSource object can be extended in interesting ways at of trust in the JVM. The repositories for as a parameter. The defineClass method runtime. Custom ClassLoaders can be

J2ME user-defined ClassLoaders have lower of SecureClassLoader gets the permis- used to achieve functionality not nor- levels of trust. Furthermore, sions associated with the CodeSource mally available to a running Java pro- ClassLoaders can assign each loaded from the system policy and defines a gram. Some of these applications have class into a protection domain that java.security.Protection been discussed in this article. defines the permissions assigned to the Domain based on that. A detailed dis- ClassLoaders play an important role in code as it executes. To define permis- cussion of the security model is beyond some of the technologies offered by sions on code based on the system secu- the scope of this article. Further details current J2EE platforms. For further rity policy (an instance of can be obtained from the book Inside details about the Java classloading J2SE java.security.Policy), a custom the Java Virtual Machine by Bill Venners. mechanism, read Inside the Java Virtual Machine. References October 26 - 31, 2003 • Liang, S., and Barcha, G. “Dynamic . . Class Loading in the Java Virtual Keystone Resort Colorado USA Machine”: www.java.sun.com/peo- ple/gbracha/classloaders.ps • Venners, B. (2000). Inside the Java J2EE Virtual Machine. McGraw-Hill Osborne Media. • Neward, T. (2000). Server-Based Java Programming. Manning Publications Company. • Gong, Li. “Secure Java Class Loading” http://java.sun.com/people/ OME

H gong/papers/ieeeic98.pdf • The Java Servlet Specification: http://jcp.org/aboutJava/communi- typrocess/first/jsr154/

Listing 1 1. public class CustomClassLoader 2. extends ClassLoader { 3. //search repository 4. private List classRepository;

5. public CustomClassLoader Quite simply, the Colorado Software Summit is the year's premier inter- 6. (ClassLoader parent,String searchPath) national JAVA & XML programming event. It's chock-full of real-world 7. {…} content for the serious Java and XML programmer — information you 8. protected Class findClass(String can actually use to move your career forward. 9. className) throws 10. ClassNotFoundException { — Renowned speakers & and a faculty of movers, shakers and 11. byte[] classBytes = 12. loadFromCustomRepository(className); problem-solvers 13. if(classBytes != null) { 14. return defineClass — A flexible, dream agenda of timely, bankable, make-you-a-better- 15. (className,classBytes,0,classBytes.length); 16. } programmer-today topics 17. //else 18. throw new ClassNotFoundException(className); — And the priceless chance to swap war stories with colleagues 19. } 20. } who “get it.” Listing 2 To register or for more information call 800-481-3389 or 719-481-3389 1. public Class loadClass(String name) for International calls. 2. throws ClassNotFoundException 3. { 4. //check if the class is already loaded 5. Class loadedClass = findLoadedClass(name); 6. if (loadedClass == null) { 7. //search for class in local 8. //repository before delegating 9...... 10. //if class not found delegate to parent Register by August 31 11. loadedClass = and save $200! 13. this.getClass().getClassLoader().loadClass(name); 13. } Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. 14. return loadedClass; 15. } Kovsky Conference Productions Inc. is independent of Sun Microsystems, Inc.

16 August 2003 www.JavaDevelopersJournal.com

J2ME J2SE J2EE

hen choosing among the different types of authentication mechanisms offered by J2EE Web containers, form-based authentication is almost always selected ahead of its alterna- tives: HTTP basic authentication and HTTPS client authenti- cation. However, beneath the customizable user interface, form-based authentication presents several challenges to

OME W

H architects looking for a robust enterprise authentication solution. These challenges often manifest themselves as login-page access errors that arise when applications look to extend the concept of protected resources upon which form-based authentication is predicated. This can occur when a system exhibits requirements that are considered fairly common for an enterprise application, such as: • Authentication must be possible from the default form–based login page without trying to first access a pro- enable tected resource. an appli- • Capture of authentication credentials must occur on mul- cation to tiple separate pages (e.g., via a login form that is a part of overcome some each nonprotected page). of the most common- ly encountered form-based authentication hurdles without In both cases, form-based authentication alone will not sacrificing the utility of the Web container’s preexisting be able to satisfy the system requirements. authentication capabilities or introducing Web container dependencies. Available Options There are three solutions that are most frequently recom- Form-Based Authentication mended by application architects looking to satisfy either of Before launching into a discussion on extending form- the aforementioned requirements. The first and most com- based authentication, it’s important to first understand what monly suggested one is to build a custom, servlet-based form-based authentication is and is not. Please note that authentication mechanism. This solution, although robust although a brief description of form-based authentication is and well documented, fails to leverage the infrastructure pro- provided here, more detailed descriptions and set-up vided by container-managed security and requires that the instructions can be found in the references section at the end authentication mechanism be implemented programmati- of this article. cally. The second solution is to subclass or interface directly Form-based authentication is, at its core, a Java-specific, with the authentication APIs provided by the Web container – container-implemented authentication mechanism that such as Tomcat’s AuthenticatorBase class. Such a solution allows the look and feel of the login screen to be customized. can only be recommended to seasoned Java programmers The login is performed via a form that must contain two and introduces a dependency on a particular Web container’s fields for entering a username and a password, j_username internal APIs. and j_password, respectively, and a special container-recog- The third solution – and the topic of this article – is the nized action – j_security_check. extension of the existing J2EE form-based authentication Beyond the login form, the application-specific imple- mechanism to satisfy these requirements. This solution will mentation of form-based authentication is dependent on

18 August 2003 www.JavaDevelopersJournal.com TM Automate unit test case generation We make software work. for JUnit and Java™ with Parasoft Jtest.

(It’s as easy as 1-2-3.)

Parasoft Jtest is the first and only automated unit testing tool for Java™ development.

With just a click, Jtest reads and analyzes code — quickly creating harnesses, stubs and test inputs — and tests without user interven- tion. Jtest also enables you to automate regression testing and stat- ic analysis. For loyal JUnit users, Jtest is designed to fully support existing test cases and automate the creation of new JUnit-compati- ble test cases. Learn how Jtest can enhance JUnit capabilities... Download a free eval copy of Jtest along with our informative new white paper entitled "Using Jtest With JUnit." • For Downloads go to www.parasoft.com/jdj08. Or call 888-305-0041. Special Offer: For a limited time, every 100th customer to download an eval copy of Jtest automatically wins a fully licensed copy — FREE OF CHARGE.

Copyright ©2003 Parasoft Corporation. All rights reserved. All Parasoft product names are trademarks or registered trademarks of Parasoft Corporation in the United States and other countries. All other marks are the property of their respective owners.

Platforms: Linux Solaris Windows 2000/XP

A part of Parasoft Automated Error Prevention (AEP) Solutions and Services the ability of an application that uses form-based authenti- cation to satisfy advanced authentication requirements. The first disadvantage of container control is that the container maintains exclusive rights to the original client URL request for a protected resource. Generally, this parame- ter is neither accessible nor settable in a programmatic man-

J2ME ner. The second disadvantage of container management of security is that, in most cases, it precludes the use of custom security filters. As an example, filters on the j_security_check action prove to be very unreliable across different applica- tion servers. The third and perhaps most important disad- vantage is that container-controlled security does not sup- port authentication unless the client is explicitly attempting to access a protected resource. This feature is often referred J2SE to as lazy authentication. That is, authentication is per- Figure 1 Active authentication flowchart formed only when it is needed – not when your application would like it to be performed. two very important elements in the Web application deploy- ment descriptor: the login-config and security-constraint ele- Active Authentication ments. The login-config element is used to indicate that an Many systems that use form-based authentication also application is using form-based authentication and to speci- wish to perform authentication before it’s absolutely fy the locations of the login and error pages to be used. The required. Such is the case with the requirements outlined at security-constraint element is used to define which resources the beginning of this article, including a login form on non- J2EE are protected and to associate role-based constraints with protected pages or a direct login from the login screen these protected resources. before accessing a protected resource – both of which will Although the implementation of form-based authentica- require “preemptive” authentication. A very compelling tion is vendor-specific, the functional specifications are out- case could be made for such functionality if an application lined in the Java servlet specification. When a user attempts contained very few custom pages or wanted to customize to access a protected resource, the container checks the its unprotected pages for particular user roles. In such user’s authentication. If the user is already authenticated and cases, the application needs to actively engage in authenti- OME

H possesses a role that is authorized to access the resource (as cation when these services are not explicitly provided by defined in the security-constraint element), the requested form-based authentication. Note that this is different from resource is activated and a reference to it is returned. If the a custom security solution in which the application user is not authenticated, the following series of events assumes all authentication responsibilities. Active authenti- occurs: cation, in this sense, implies that the application augments 1. The login form is sent to the client and the original client the form-based authentication services already provided by request is stored by the container. the container. 2. The client posts the login form back to the server, which The first step in designing and implementing an active then attempts to authenticate the client. authentication system is to understand that there are a finite

“Many systems that use form-based authentication also wish to perform authentication before it’s absolutely required”

3. If authentication is successful, the user’s roles are com- number of authentication entry points into a system. For pared to the roles necessary to access the resource. If the each of these entry points, form-based authentication will user’s roles authorize access to the resource, the client is either handle authentication for you or it will default to its redirected to the resource using the original request URL lazy authentication posture and not handle authentication. path stored by the container in the first step. For demonstration purposes, the remainder of this article 4. If authentication is not successful, the user is redirected to will deal with a system that has three possible authentication the error page defined in the login-config element. entry points: 1. Direct access to protected pages The good news about form-based authentication is that 2. Active authentication from all unprotected pages via a the container takes care of a lot of the hard work. login form included in each of the pages Authentication, authorization, redirection to the login page 3. Direct login from the login page defined in the Web appli- and back to either the protected resource or the predefined cation deployment descriptor error page are all handled by the container. However, this level of container control over authentication and authoriza- Figure 1 illustrates the active authentication flow for the tion carries with it several disadvantages that directly affect model’s three entry points. Please note that Figure 1 does not

20 August 2003 www.JavaDevelopersJournal.com include post authentication activities since these activities amounts to: are controlled entirely by the container. Of the three authentication entry points in our model,

only point 1, direct access to protected pages, is handled by

J2ME You can easily test this assertion by entering valid credentials into a simple form with an action of j_security_check before

you have tried accessing any protected resources. Doing this will result in an error such as “Invalid direct reference to form Login Router Servlet login page.” In other words, the application will have to take The Login Router Servlet is one of the pillars of active care of referencing the form login pages to prevent this type authentication, yet it’s very simple to understand (see Listing of error from occurring. 1). For authentication entry point 2, which covers all unpro- The purpose of the Router Servlet is threefold. First, it sets J2SE tected pages, a special login include needs to be created with session attributes for the values passed by the login include an action that posts the user’s credentials to the Login Router or by the default login page (login.jsp). Session values are set Servlet. The Login Router Servlet sets the appropriate login because other values, such as request attributes, do not per- session variables, makes note of the unprotected page that sist across redirects. Second, the Router Servlet retrieves the requested active authentication, and redirects to the Proxy originator of the request so that this page is reloaded when JSP. The Proxy is defined in the Web application deployment active authentication is complete. Note that this must be descriptor as a protected resource. Therefore, any request for done differently for each of the possible request originators: the Proxy will be subject to authentication by the container. the login include or the default login page. Finally, the Router The Proxy’s job is to keep track of the original page that redirects to the protected page Proxy.jsp, which will cause J2EE requested authentication. The Proxy then redirects back to container-managed authentication to be invoked. the original page when the container has returned control to the Proxy. Login Proxy (Proxy.jsp) Authentication entry point 3, direct entry from the The Login Proxy is likely the simplest component of default login page, requires that the page be smart enough active authentication. As mentioned earlier, the sole purpose to recognize the difference between a request to log in to a of the Login Proxy is to keep track of which page originally protected resource and an active authentication request. requested authentication, and redirect back to this page OME

H When active authentication requests are received, the login when authentication and authorization are complete. The page should display some sort of selection mechanism that most important point to remember about the Login Proxy is allows the user to choose a page to be routed to after that it must be identified as a protected resource using the “The first step in designing and implementing an active authentication system is to understand that there are a finite number of authentication entry points into a system”

authentication is complete. This option will not be Web application deployment descriptor. Once you’ve done required in the case of an attempt to access a protected this, the Login Proxy basically amounts to a couple of lines of resource. essential code: Authentication Synthesis String redirectURL = session.getAttribute(“originator”).toString( ); Now it should be apparent that although form-based response.sendRedirect(response.encodeRedirectURL authentication alone does not satisfy all the requirements of (redirectURL)); an enterprise application, it does provide a solid foundation upon which to build. The remainder of this article will focus Default Login (Login.jsp) on the four software objects that are needed to support the The Default Login page is probably the most complicated By day, Thomas Beck is actively synthesis of active and form-based authentication. These moving part in active authentication, handling two very involved in the design, develop- four objects will be described below. Source code for these important responsibilities. First, this page needs to deter- ment, and integration of enter- objects can be downloaded from www.sys-con.com/java/ mine whether it was requested by another page within the prise systems as a senior consult- sourcec.cfm. application or if the URL was requested directly. Based upon ant for Deloitte Consulting. By these conditions, the Default Login will or will not render a night, he is working on a book Login Include selection mechanism that allows the user to choose where about developing enterprise soft- The login include file is used by unprotected pages to they should be directed to after authentication. Second, the ware solutions with open source enable users to log in from any point (i.e., protected or Default Login may redirect to j_security_check for authenti- tools. Thomas holds Java certifi- unprotected) in the application. Without belaboring the cation, where applicable. cations from both Sun and IBM. point, the login include is very similar to the standard form- Before delving into the Default Login page, it’s impor- based authentication login. The essential code for this tant to first understand how the page handles its different [email protected] include, without additional markup and style elements, rendering states. Login.jsp is defined as both the form login

22 August 2003 www.JavaDevelopersJournal.com

and form error page in the Web application deployment Despite the different approaches, the final result of active descriptor, using query string values of “action=protected” authentication is the same as the final result of form-based and “action=error”, respectively, to denote conditions authentication. If the user is authenticated and authorized, requiring initial or subsequent authentication. he or she will be returned to the page requested. If not “Action=logout” will also be set by the application when a authenticated, the user will be returned to the Default Login user wishes to log out. Given these three states, the Default page and an appropriate error message will be displayed.

J2ME Login page should render a selection mechanism to allow the user to select a page to be forwarded to upon authenti- Conclusion cation if: When selecting an authentication mechanism for your 1. The user is logged out. next enterprise application, resist the urge to reinvent the 2. The page URL was requested directly. wheel. With the exception of lazy authentication, form- 3. The page’s action value is something other than “protect- based authentication is likely to be a suitable authentica- ed”, “error”, or “logout”. tion mechanism for your application. With some patience and the active authentication components from this article, J2SE This determination is represented in Listing 2 by setting you can help form-based authentication overcome its lazy the isSearchSet variable to true if a page selection mecha- ways and meet your application’s security requirements. nism needs to be rendered. If a page selection mechanism does need to be rendered, References the j_username and j_password authentication inputs are • Almaer, D. (2001). “Web FORM-Based Authentication.” rendered along with a mechanism that sets the value “ORIG- O’Reilly: INATOR” (see Proxy.jsp) to one of a series of page names for www.onjava.com/pub/a/onjava/2001/08/06/webform redirection after authentication. The action of this form .html should be the Login Router. A page selection mechanism • Arumugam, P. (2002). “J2EE Form-Based Authentication.” J2EE should not be required for the form login or error page. In O’Reilly: this case, a normal form-based authentication login group www.onjava.com/pub/a/onjava/2002/06/12/form.html using the j_security_check action should be rendered. • Bergsten, H. (2002). JavaServer Pages, 2nd Edition. O’Reilly. The default login page’s second yet equally important • Hall, M. (2001). More Servlets and JavaServer Pages. responsibility is redirecting to form-based authentication Prentice Hall. and removing the session’s login attributes when the page is • J2EE Platform Specification: first loaded. If these login attributes are not removed, the http://java.sun.com/j2ee/1.4/download.html#platform- OME

H application will enter an infinite redirect loop by continually spec posting invalid credentials. This can be avoided using the • Java Servlet 2.3 Specification: www.jcp.org/aboutJava/com logic provided in Listing 3. munityprocess/final/jsr053/

24 August 2003 www.JavaDevelopersJournal.com Forced to choose between HTML and Swing?

HTML Swing

Are your users frustrated by clicking on page Are you facing deployment problems due to after page of your HTML web application? the need to install plug-ins when using Swing? Do you want your users to quickly navigate Do you want your applications to be through thousands of records on the web? accessible from any browser anywhere?

Now you don’t have to compromise. Get the best of both worlds with Asperon. Asperon's next generation AppProjectorTM technology includes a unique client that is as portable as HTML and as interactive as Swing. This allows you to quickly and easily develop web applications that have desktop-like user interfaces that do not require a plugin or client side install.*

High HTML Asperon • Up to 10x faster than developing your own custom Swing client.

ent • Scroll through 10,000 records in seconds! ent JavaScript Swing

& Deployment • Standards based - uses only Java/XML. Client Server Low Ease of Development

Low High • Real-time dynamic updates from server. Interactivity

TM

www.asperon.com

* Works on most popular browers version 4.0 and above. Download your free trial version today! J2SE INSIGHT

Jason Bell J2SE Editor JavaOne

he JavaOne conference passed me by stating opinion. I suppose there is an J2SE this year, as did the previous seven. I art to reading blog sites. I won’t go on never get the time to attend these about the spelling mistakes (there are things since I’m in the UK and it’s a some blogs that read like neat Latin). long journey. So I sat back in my big Were there any other highlights of T developer’s chair and watched the Java JavaOne? The java.net community site world pass by like Weblogs in the was launched; I think it’s a move in the night. right direction. I do wonder though Hyper-Threading J2EEOne of the hot blogging J2ME topics cov- how the well-established community Java ered was, of all things, Christina will take to it. The first casualty I was 36 Aguilera. More to the point, you could notified about was that javagaming.org access vital Christina information via had moved its message boards to the mobile technology. From a Java tech- new java.net site. There were many nology perspective, Sun hit the nail complaints that the message board right on the mobile device head. From postings were not available, but then JavaOne where I sat developers got the all was well. The JavaOne conference OME

H java.com site all wrong; here’s a hint – It was nice to see that James passed me by this year, as did it’s not for developers! I was really Gosling now has a blog of sporadic the previous seven. So I sat back 26 happy to see the new site; Sun is finally content. He also posted his blog soft- marketing in the right direction for ware on the site (and the shell scripts in my big developer’s chair and Java technology. They’ve figured out to ftp/sftp the content; I can just see watched the Java world go by how to sell to the consumer. We can the Java purists staring into their coffee like Weblogs in the night. One of send the rocket scientists and muttering, “He used shell scripts,” the hot blogging topics covered home now. with complete distain). By doing this was, of all things, Christina Java in the developer James also showed how to get the job domain is all very well, but done, neatly, cleanly, and the fastest Aguilera. More to the point, you if it’s not exposed properly route to a working model. So what if he could access vital Christina infor- to the consumer, then I uses shell scripts? It does the job per- mation via mobile technology. may as well go back to Perl fectly and it inspires me to write some coding, as I won’t have a Windows batch scripts to do the same steady job in 12 months. thing. Figure 1 Christina checking out The other hot blog- Blogs are here to stay but I have to her own fashion tips ging topic was Rave crash- question some of the content. As a Java Games ing on its first run. (I know reader I’m looking for fact, not opin- Development this never happens to you guys.) Code ion. At the time of writing there are will always work until it’s shown in only about five blogs I can say, hand on JDJ has gathered together an public; the general rule of thumb is the heart, that I read on a regular basis. eclectic group of interested par- 28 larger the public gathering, the larger Hopefully, reading the blogs of some of ties to discuss Java games devel- the crash-and-burn element. Sun’s employees will reassure me that opment and what they think The blogging community once all is well in Javaland. again has shown its major traits: first, needs to happen to shift mind as a community it can have the latest Blogs of Note share away from C and C++ Jason Bell is the senior program- news up in a matter of minutes. Alan • Matt Biddulph: toward other languages/plat- mer for a B2B portal. He’s also a was blogging while the keynotes were http://hackdiary.com forms, such as Java. keen supporter of people read- happening; all I have to do now is dis- • Edd Dumbill: ing the API docs before asking cipline myself to read them. Now I http://usefulinc.com/edd/blog questions. In his spare time he’s don’t want to lift our illustrious leader • Russell Beattie: involved with building RSS devel- up too high but he does state facts and www.russellbeattie.com/notebook opment tools. not opinions most of the time. This is a • Charles Miller: http://fishbowl.pas- strong point. The second trait I noticed tiche.org is a number of bloggers spend most of • Mark Pilgrim: [email protected] their time venting their spleen and http://diveintomark.org

26 August 2003 www.JavaDevelopersJournal.com

FORUM Java Games hosted by Jason R. Briggs Development [email protected] Part 1 of 3 – Let the games begin

recently had a hankering to play an The players are: JDJ: C and C++ have the market (and older (not ancient) PC game that I mind) share in terms of games develop- J2SE used to enjoy. Since I’ve moved my Jason R Briggs: Java Developer’s Journal con- ment languages. Indeed, the main- entire desktop over to Linux (for tributing editor and your host; games player stream games market has traditionally almost a year ago now) that meant when he has time, games developer…on occa- been very reluctant to change develop- I stealing my wife’s Windows laptop and sion. ment paradigms. What do you think trying to install the game on that. Two Gerardo Dada: Metrowerks’ product manager for needs to happen to shift that mind FDISKs and one Windows reinstall CodeWarrior Wireless Studio. share toward other languages/plat- later the laptop’s HDD is still woefully Erik Duijs: Former musician/engineer/producer forms, such as Java? J2EEshort of a game, and J2ME I’m back at with a (games) programming passion, now an IT square one. consultant. Switched careers for the sake of bet- Jeff K: It is important to remember that This isn’t an isolated case – there’s a ter pay as well as maintaining a passion for we were asking almost the exact same whole backlist of games that in an music instead of “eating it” so to speak. Author question about C++ less than 10 years occasional retro mood I’ve felt like of the Java Emulation Framework (JEF) and ago. And before that it was C versus having another go at…even to the CottAGE. assembly code. More recently, scene- point of attempting to get some of Shawn Kendall: Developed Java and Java graph systems such as RenderWare them working in various 3D–based game technology demos for Full Sail, were fighting the same OME

H DOS/Windows emulators on my Linux Sun Microsystems, and I.M.I., and displayed at perception/adoption battle. machine (with only limited success), GDC and SIGGRAPH since 1999. He has five years In the end, nothing succeeds like because it’s just as much of a pain in of 3D technology teaching experience, and in success. A hit game ships in pure Java the proverbial posterior to get them 2002 founded Immediate Mode Interactive, LLC, a and it will put all the nay-saying to rest. running on later versions of Windows game technology company dedicated to the To get there though there are many as on what the games were originally development and application of Java technology things that can help. Outreach and intended for. in computer games (www.imilabs.com). education are two of them. Our indus- I would even be tempted to dish out Jeff Kesselman: Architect for game technologies, try runs to a large degree on “common a few bucks to buy retro games, if I Advanced Software Technologies Group at Sun. knowledge.” Insofar as it’s wrong (e.g., could only be sure that they were actu- He worked on the JDK performance tuning team “Java is slow”), we can educate and ally going to run successfully. and co-wrote Java Platform Performance: help change perceptions. Part of this is How much easier would this Strategies and Tactics. explaining why these preconceptions process have been if some of these Chris Melissinos: Sun’s chief gaming officer and are wrong; the other part is proving the games had been written in Java? The responsible for driving an industry-wide move- point with working demos. We can also sad fact is a lot of them could have ment toward Java technology–based game devel- explain the perceived and less-known been developed in our favorite lan- opment and building infrastructure programs for advantages. Portability is the one every- guage had Java 1.4 been available 3–5 massively connected game play. one usually thinks of, but there are per- years ago. Assuming there wasn’t a Caspian Rychlik-Prince: An IT consultant in the UK haps even stronger advantages in the huge reliance on quirky native bind- who for the last 10 years has specialized in areas of productivity and code-correct- ings, they would probably be relatively client/server systems with RDBMS back ends. ness. easy to get running now. Alternative Since the contract market in the UK has all but Finally, we need to unsell some of platforms needn’t be a huge issue either dried up, he has shifted focus to creating assets the oversold aspects of Java – portabili- (also assuming that those native bind- rather than doing a job, so he’s writing a game ty being a good one, in my opinion. ings were available on your platform of now. One-hundred percent portability is not choice). Doug Twilleager: Chief architect of the Java only unlikely but in most cases unde- All of this had us thinking at JDJ (yet Games Initiative at Sun Microsystems. One of the sirable for games that should ultimately again) about games development in architects of Java 3D, he has also worked in the be tuned for each platform. I personally Java. Some might say it’s flogging a graphics research group at Sun looking at think 85% portability is a more sensible dead horse; some would just wonder advanced rendering techniques and programma- and reachable goal. why, despite the cross-platform and ble shading. preservation of investment advantages David Yazel: VP of software development of trad- Doug T: One of the biggest obstacles that I’ve just mentioned. Which is the rea- ing systems and portfolio management systems desktop Java faces right now is the abil- son we’ve gathered together an eclectic at a leading financial investment company (by ity to access the latest game technolo- group of interested parties to discuss day), and by night a games developer for (and gies in a standard way. There are lots of that very topic – Java games develop- founder of) the Magicosm project (a 100% Java- community supported solutions for ment. based MMORPG). things like 3D, audio, and input device

28 August 2003 www.JavaDevelopersJournal.com

FORUM

support. However, until there is a wide- party technologies such as Physics advantages of C++ are difficult to spread standard available across multi- engines, AI, and human rendering. ignore. But we all know that once we ple platforms, developing desktop I also agree with Jeff; once you have get comfortable with something and clients will be painful. These standards a success story – a developer who good at using it we have a very strong don’t need to come from the Java builds a great game and leverages the tendency to stick with what we know – Community Process; de facto standards portability of Java to reduce the invest- and that’s actually very wise. I suspect work just as well. There are, of course, ment and time-to-market to offer it in we will have to wait a long time for the other game areas where Java is gaining multiple platforms (PC, Mac, PS2, etc.) veterans to gradually leave the industry acceptance. An example of this is – then the industry will start paying and take their own ways with them. mobile device games. attention. The second factor is higher educa- tion courses. A lot of people who grad- Gerardo D: From my perspective there are Jeff K: Actually that is not strictly true of uated from university in the past 10 three things that must happen to modern desktop VMs. About the only years started out on something useless change mind shares toward Java. One is thing AOT compiling gives you in the like Modula-2 to learn programming J2SE performance – game developers are all desktop space is faster start-up. AOT and got into C++ as their courses pro- about optimization: getting one more compilers by all tests I’ve seen are slow- gressed. They left university with a frame per second allows them to add er then JITs in an actual run, or, if they working knowledge of C++ and were more details and textures, more calcu- manage to reach JIT speed, do so at the very likely exposed to MSVC6. That lations to the physics involved, and expense of a seriously bloated foot- gives you a huge pool of C++ program- more realism and improve the overall print. To put it simply, this is because a mers. Nowadays, a lot (most?) of the game experience. Java is still perceived JIT adjusts the code generated at run- C++ courses are being replaced with J2EEas slower than compiled J2ME C/C++. time according to the actual runtime Java – and if not Java I understand Perceived is the key word here – there environment (e.g., processor type) and Delphi is very popular (also for good are AOT compilers for Java and DAC how it’s actually used (e.g., in-lining reasons). In the middle of the next technologies that reduce the perform- methods that are “used” monomorphi- decade a fresh-faced C++ programmer ance hit of having a virtual machine. If cally whether they are provably defined will be a rarity, mark my words. you ask game developers who develop that way or not). However, it does mean that the vast games for wireless devices, a J2ME I am specifically excluding J2ME majority of Java programmers out there game usually performs faster than a here, because obviously in the tiny are really inexperienced and won’t have OME

H C++ version of the same game running memory and highly constrained envi- very many experienced Java program- on BREW. ronment of current cellphones you mers to learn from. This is the ascen- Number two is access to low-level can’t effectively deploy a JIT solution, dency. As Jeff alludes, it took 10 years stuff. With C++ you don’t have to wait and here (and only here) I would agree for C++ to finally oust C. However, it two years for a JSR and an implemen- that an AOT compiler might make would probably be a true case of hype tation to use a low-level function. sense. However, this is a temporary if we were to claim that Java’s time is Console manufacturers try to differen- phenomenon as we are seeing cell- right now – it’s not; it needs that 10 tiate and add new technologies for phones quickly rise to PDA level and years. I think there may be a correlation PDAs quickly reaching the size of set- between 10 years and the length of

“We need to unsell some of the oversold aspects of Java – portability being a good one, in my opinion” –Jeff Kesselman

top or small desktop systems. It’s rea- time the average programmer remains sonable to assume this trend will con- in the games industry. It’s a genera- developers (like vectorization) that tinue for awhile at least. tional thing. Right now I think we’re would be hard to use from Java. three years in: by 2010 the majority of Developers want to use maximum Cas P: I have to be very careful answering games will probably be written in Java, performance and all the features of a these types of questions. Like a lot of but only if certain things are done to console or a PC. An option would be engineers I have a binary world view, Java to make it as flexible (and indeed, JNI. but I’ll try to be reasonable. as powerful) as C++. Three is industry support – outreach The C/C++ market share is a prod- Apart from waiting, the real disad- and education like Jeff mentions, but uct of many factors. The first and fore- vantages of Java would have to be also things such as middleware tech- most is inertia: all the people currently addressed before you see any signifi- nology. As games become more com- in the industry who are now experts at cant shift in mind share occurring. I’ll plex and platforms have higher per- what they do write in C++. The C crowd stick my neck out here and say that the formance, developers rely on third- is actually dying away because the frequently quoted productivity benefits

30 August 2003 www.JavaDevelopersJournal.com

FORUM

of programming in Java are largely nul- VM overhead is too great to be a rea- results in many places. (This is for- lified when writing games because of sonable proposition. That doesn’t nec- malized in many games by creating a the horrendous amount of work essarily mean you can’t use Java, but “scripting” layer that in fact is dog- involved in getting performance and because of a curious licensing restric- slow in raw speed terms.) Even where quality out of the finished product, tion it does rather restrict what bits of you need to tune, premature opti- right down to writing OpenGL wrap- Java you use. mization often creates more trouble pers up through fooling around trying This brings me to a remedy for that than it solves. to fill structures in buffers without disadvantage – the “J2GamingEdition” A classic example that gets worked direct language support, through – which is almost but not quite what over and over again is the Java collec- avoiding the wrath of the garbage col- we have with the J2ME CDC profile. tion classes and the ways they create lector. That’s just one of the technical What I’d really like to see in terms of garbage. When I use collections I never disadvantages. It also happens to be a licensing is that the Java 2 platform is specify specific types (e.g., ArrayList). performance disadvantage in a particu- cleanly separated from the Java 2 run- All my variables are of Interface types larly critical section of a game loop, and time environment, with only java.lang (e.g., list). This allows me to easily tune J2SE that’s going to be picked up on very being necessary to run the JVM. This on two levels. If I find a linked list is early by anyone trying to do something gives the developer the feeling of being really more appropriate by the time I’m cutting edge. close to the metal, mean and lean. It’s a done, I can change it by simply chang- crucial comfort factor in programming ing the type after the new one. But if I Jeff K: I would classify this as “matura- games to know that you can solve any find none of the supplied implementa- tion” and a learning curve myself. In problems by yourself through pro- tions work the way I need, I can in fact the maturation category is the OpenGL gramming, not waiting. It’s bad enough write my own special case implementa- J2EEwrappers you mention. J2ME It’s insane that waiting for OpenGL drivers that work tion at that time. everyone currently feels a need to do and hoping there are no VM bugs with- I would argue that this all still this themselves. I’m convinced stan- out dicky implementations in the results in major time savings over dards would emerge under any condi- java.* libraries causing a performance guessing at the beginning of my coding tion, and the conditions are actually hit or bugs. It’s particularly important what the ideal data structures would looking good for this to happen fairly to stress how little of the standard Java be, and then either living with a bad soon. libraries are actually useful in games guess or doing major code rework. In terms of taming and controlling programming. One of the reasons Java Finally, I personally think too much OME

H the GC, that’s a matter of the learning is so productive in the normal applica- emphasis is placed on the high-level curve. As in any language, you develop tion space is that it has a rich set of Java features when talking about cod- habits in how you use it as you come easy-to-use features. But use them in a ing efficiency. There are more funda- up to speed. game and you discover why they’re mental ways in which Java promotes I actually think it’s remarkable if easy to use: they’re not tuned; they’re proper code and accelerates its devel- Java’s advantages in performance even very inefficient in most unexpected opment. Most of these can be classified end up making the learning curve a ways. No doubt more on this topic under one key Java design goal: wrong later. code should fail early.

“By last year, every Java IDE out there had surpassed the incumbent C++ IDEs in terms of functionality and ease-of-use”

–Caspian Rychlik-Prince

Jeff K: Licenses aren’t set in stone. With There are whole classes of C/C++ net-zero cost. From what I know, it good enough reasons, corporations can errors that just won’t compile in Java would be the first time that was true for change them (in point of fact, in one- (e.g., using uninitialized variables). any new language or environment and off ways Sun already has). Still, I agree There are many other common ones Java is both at once. 100% that one of the bigger barriers that will throw an exception right away right now is the unfortunately restric- in Java, whereas in C they hide till late Cas P: Another disadvantage is depend- tive Java license terms and I’d personal- in development or worse get out into ency on the correct VM being installed ly like to see that change. the field (e.g., null pointer access, array on the target platform. If you were to In terms of the standard Java overrun/underrun, etc.).While I agree find Java on the next PlayStation (so libraries, here I would disagree. It’s the that a lot of the Java libs aren’t useful help me, but if it has OpenGL on it too old 90/10 rule. Ninety percent of your for games, I think the problem is that I’ll be over the moon), you’ll be fine, of work is done by 10% of your code. You they aren’t designed for what we do and course, because it’ll be guaranteed can afford to trade efficiency for thus provide functionality that isn’t available. But for smaller games, the speed of coding and correctness of useful. (Anyone writing a game client

32 August 2003 www.JavaDevelopersJournal.com Diagnose and resolve J2EE performance problems …now in production

PerformaSure™ Now you can take advantage of PerformaSure’s exclusive Tag and Follow technology to diagnose and resolve J2EE performance problems in production. Tag and Follow traces and reconstructs live end-user transactions across the JVMs, web/application servers and databases of your distributed J2EE system. Get to root cause with PerformaSure.

PerformaSure’s new features reduce overhead to rock-bottom levels:

• Ultra low-overhead production-grade agents • Component-level instrumentation and detail dial • Automatic sampling and filtering, and more

Take a tour of PerformaSure today: http://java.quest.com/performasure/jdj

© 2003 Quest Software, Inc. Quest, Sitraka, PerformaSure and JProbe are trademarks or registered trademarks of Quest Software, Inc. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All other products are trademarks or registered trademarks of their respective companies. FORUM

that uses SQL?) But I don’t think it’s as sized brush and the same three paints. this doesn’t mean it shouldn’t be big a hit on the Java productivity story But the end result is the same – it’s a addressed, but I don’t feel it’s a valid as some folks might first assume. big, big chink in the Windows monop- argument against using Java. oly’s armor. M$ doesn’t really have a Most of all, right now we need some Cas P: For sure, and this is its best fea- chance to compete any more, and this kind of Carmack that proves this point ture. Currently though I’m finding is quite remarkable. to a broad audience in a some classes of error difficult to deal Back on topic for a moment, start- Wolfenstein3D/Doom kind of way. I with, like bunging data in the wrong up time is another issue for Java. It’s feel that’s much more important than place in a DirectByteBuffer because of a actually quite acceptable in the client solving technical issues, which I believe language hindrance. It’s swings and VM, but performance is very disap- we can already work around. roundabouts, but more swings in gen- pointing. Start-up time in the server eral, and that’s a good thing. VM is terrible, but performance is the Shawn K: Shifting mind share is simple. It A side effect of this is that the IDEs in equal of C++ in many areas (it’s cur- is not a technology question. It is a Java are of absolutely stunning quality. rently still much worse, 50% at best, at “proof (for developers) and money (for J2SE By last year, every Java IDE out there had floating point and memory access publishers/managers)” question. All surpassed the incumbent C++ IDEs in though – and that’s unfortunately real- that’s needed is one big, high profile terms of functionality and ease-of-use. ly where it counts in games right now). hit. That’s all. Many developers scoffed Eclipse is taking on MSVC head on and Again, “J2GE” could do with a hybrid at RenderWare in the beginning, but winning by a long shot. This is a great VM reference implementation that when huge hits like Tony Hawk 3 and thing; for years the de-facto hard-core perhaps did a two-phase compilation. GTA3 (Grand Theft Auto III) were Windows development tool was MSVC, These ideas have been talked about for released, they really put it on the map. J2EEand the other C compilers J2ME were for at least two years now but we come to Now, how to make a hit with Java? eccentrics and specialists. We have a sit- another stumbling block: Sun doesn’t That’s an entirely different question. As uation here in which there are at least have the resources and certainly does- a quick high-level answer I’ll say it will five different major IDEs, and because n’t have the will to make it happen. take all the things that are needed to they all produce identical code, there is make a game a hit regardless of lan- absolutely no reason why a team could- Jeff K: Maybe I’m an old fogey but start- guage, as well as significant (read $$$) n’t use all of them to write a game. I’ve up time still seems pretty fast to this kid changes to Java for consoles, in addi- always found it rather like giving a bunch who grew up with a C64. I do agree, tion to some serious support for J2SE. OME

H of artists a set of paintings to create and however, that it’s unfortunate that I was at the Digital Media Alliance of then saying they all have to use the same nothing can be done during the load- Florida meeting recently, here in up. If it were my commercial Orlando. The panel discussion had a lot game I’d probably write a to say about independent developers, a machine-specific bumper place where game developers are willing that has a splash-screen and to take risks on game design and game some animation up on tech… Even though one of the repre- screen, then starts the VM. sented companies there was an inde- Also, as an aside, Apple’s pendent, the general consensus was that been doing interesting things indie development is going away unless with start-up time in their some kind of big indie festival with con- version of Hotspot. tract awards is created, because publish- ers will not/cannot afford to back exper- Erik D: I think execution speed imental games and experimental tech. is a very overrated argument It’s that simple. The industry is more hit for using C++. As game proj- driven than ever due to the fact that ects grow more complex, the more people than ever have multiple language should keep up in consoles, and the majority of players are order to minimize production only buying AAA titles now. costs. I notice that it’s getting The buying characteristics have increasingly likely that when changed from the one console days. you buy a game, it’s going to Players would buy an average of 5–6 be more buggy than the pre- games a year, and 1–2 of those would vious game you bought. This be second-tier indie-type games. Now, is directly related to the prob- you can buy all 5–6 as AAA titles lems C++ has in terms of pro- because you get big games but on dif- duction costs; problems that ferent platforms. Publishers know this Java can help address. The and are shying away even more from few frames per sec you might small production, indie-type projects. lose with Java is not really Add to that the much higher cost of important. I think Java’s speed developing current 3D games as com- is acceptable and getting bet- pared to the 2D world of the past, and ter. GC issues are there, but the risky indie market gets squeezed to Unreal also has GC, which is a speck. sometimes clearly visible and nobody complains. Of course, This discussion on Java games will continue

34 August 2003 www.JavaDevelopersJournal.com SEIZE THEPOWER Why James keeps coming back: “OracleWorld is great for networking and establishing relationships with Oracle experts and users, along with learning about the latest industry trends and developments.”

James Holmes Java Development Consultant ATTENDEE SINCE 2002

This year at OracleWorld find out how Oracle powers the Grid — and what this means to you. Join us as Larry Ellison unveils Oracle10G — the first database designed for emerging grid computing.

Get the information you need at OracleWorld.

REGISTER TODAY! oracle.com/start keyword: OW2003 1.800.355.5808

September 7-11 Moscone Center, San Francisco

Platinum Sponsors Premier Sponsor

Copyright © 2003, Oracle Corporation. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. HHypeer-ThreadingT

by Paul Bemowski J2SE J2EE J2ME OME

H Java SMT technology is here to stay

n early 2002 Intel became the first chip manufacturer ground thread – the garbage collector. SMT holds the to release a processor incorporating a new technology promise of significantly increasing Java’s server-side known as Simultaneous Multithreading, or SMT. Intel’s performance by more completely utilizing existing SMT implementation (dubbed Hyper-Threading or processor cycles in multithreaded applications. HT) has been available in their Xeon processor line for This article attempts to explain the concepts of over a year, with little fanfare. In April 2003, Intel Simultaneous Multithreading in layman’s terms, pre- announced that HT technology will be added to its sents the development of an n-thread benchmarking desktop-focused Pentium 4 line of processors. With suite, and uses that suite to produce concrete results HT enabled on one of these new systems, the BIOS of multithreaded benchmarks on HT and non-HT sys- will present a single processor to the tems. We’ll investigate various operation types to as two logical processors. determine the factors that affect Java performance As Java developers, we should all be excited about enhancements on Hyper-Threaded processors. Finally this new feature of Intel processors. The a series of conclusions and speculations are derived java.lang.Thread object was one of the key factors from the data collected. driving Java to the strong position it enjoys in the serv- er-side applications market. Both client and server Understanding Symmetric Multithreading applications written in Java often make heavy use of on Intel Processors threads. Indeed even if an application does not use Intel processors with HT technology carry two threads explicitly, all JVMs will use at least one back- copies of the processor’s architectural state on the I36 August 2003 www.JavaDevelopersJournal.com same chip. This second architectural state stores a second thread multiple threads operating on the physical processor. If a thread context. Conceptually, this type of processor architecture splits encounters a long latency, the processor will immediately exe- each physical processor into two or more logical processors. cute the instructions of the second on-chip processor state. For Physical SMT processors present themselves to the operating two threads accessing the same processor resources, the system as separate logical processors. As we’ll see later, it can onboard scheduler will interleave the threads much the same as then become important for the operating system to be aware of a software thread scheduler. This interleaving has a small and to differentiate between logical and physical processors. amount of overhead, which can decrease the efficiency of the Figure 1 illustrates the difference between SMT and non-SMT processor in certain situations. On an aggregate basis, however, processors. processor performance is increased. What is the benefit of SMT? As it turns out, the more expen- Using SMT it becomes apparent that depending on the work sive processor resources can find themselves underutilized while that each thread is doing on adjacent logical processors, we an active thread performs long latency operations. A cache miss, could see performance increases or decreases. Various papers for instance, will require the processor to make a request to (see references) studying multithreaded performance indicate main memory. The majority of the processor’s resources remain generally positive results, with some research indicating per- idle for this period of time; however, the processor presents itself ceived performance gains as high as 50%. to the operating system as busy. SMT systems use this slice of time to execute the operations of another on-chip thread con- HT-Enabled Systems text. Intel Hyper-Threading requires support from three funda- SMT processors contain an onboard scheduler to interleave mental components of a system:

www.JavaDevelopersJournal.com August 2003 37 “The more expensive processor resources can find themselves underutilized while an active thread performs long latency operations”

1. The processor less sophisticated thread schedulers make complete use of 2. The chipset available physical processors. The chipset will present the 3. The operating system logical processors to the OS as follows:

Processors Supporting HT Logical CPU0 = Physical CPU0, Logical CPU0 Hyper-Threading was incorporated into the Xeon class Logical CPU1 = Physical CPU1, Logical CPU0 J2SE processors in early 2002. Xeon is not to be confused with Logical CPU2 = Physical CPU0, Logical CPU1 Pentium III Xeon. When Intel changed the Xeon’s core to P4, Logical CPU3 = Physical CPU1, Logical CPU1 it dropped the P4 designation, calling the processor simply Xeon. Recently, HT has found its way to the desktop P4 Operating Systems Supporting HT processor. Not all processors in each of these processor class- Given a processor and chipset that support Hyper- es are capable of Hyper-Threading, however. Threading, the operating system must also be HT aware. Table 1 indicates which processors support Hyper- Table 2 shows the OS support for several currently available J2EEThreading. The table J2ME also indicates factors that you can use operating systems commonly run on Intel-based hardware. to determine whether a given Intel processor supports HT. With the release of the 3.06GHz Pentium 4, Intel changed Windows the P4 logo, incorporating the letters H and T to indicate that The Windows 2000 operating systems do not differentiate it’s a Hyper-Threading processor. between logical and physical processors. Therefore a 32- All recent Xeon processors support Hyper-Threading, but processor HT system will support only 32 logical processors. again, be sure to watch out for the 256KB L2 Cache version, It will work; however, the additional processor resources will which does not. not be utilized. OME

H Windows users should check software licensing agree- Chipset Support for HT ments to confirm that they recognize logical processors. Not all chipsets support HT. Check with your chipset Generally XP will support licensing on a per physical CPU manufacturer to ensure that you can enable and disable HT basis, while Windows 2000 will see logical processors as support via the BIOS. physical processors for licensing purposes. All HT chipsets interleave processor numbering to help Figure 2 shows a Windows XP Pro task manager on a dual- processor HT system, note the four distinct “CPU Usage History” charts depicting the Processor Class Speeds Determining Factors four logical processors.

Pentium 43.06GHz Only the 0.13 micron, Linux3.06GHz, P4 with a 533 or 800 MHz system bus Xeon 1.8 to 3.06GHz Only Xeon’s with 512KB L2 cache support HT The 2.4 kernel began supporting Hyper- XeonDP 2.0 to 3.06GHz Only Xeon DPs with 512KB L2 cache support HT. Threading on the Intel Xeon processor as of Xeon MP 1.4 to 2.0GHz All support Hyper-Threading version 2.4.18. The thread scheduler in 2.4, however, does not understand the difference Table 1 Intel processors that support Hyper-Threading (as of this writing) between logical and physical processors, in addition to many other SMT scheduler opti- mizations, similar to the Windows 2000 family OSHT Support Physical CPUs of products. This can lead to degraded perform- Windows XP Server Supports HT 32 ance in situations where two threads are sched- Windows XP Pro Supports HT 2 uled concurrently on one physical processor, Windows XP Home Supports HT 1 while the other physical processor is left idle. Windows 2000 Server No differentiation between physical and logical processors 32 As of kernel version 2.5.32, the thread Windows 2000 Pro No differentiation between physical and logical processors 2 scheduler was updated with advanced fea- Linux, 2.4.x kernel Supported from version 2.4.18. No differentiation between tures to support Hyper-Threading. The 2.5.x physical and logical processors. 32 kernel is the development branch that will Linux, 2.5.x kernel2 Enhanced thread scheduler available from 2.5.32. 32 become the 2.6 kernel. The exact release Table 2 Operating system support for SMT schedule for 2.6 is unknown, but in a recent interview Linus Torvalds indicated that 2.6 would likely be released in Q4 2003. Operating System Windows XP Pro Red Hat Linux 7.3 with 2.4.18 Figure 3 shows a Red Hat 7.3 installation Processors 2x Pentium Xeon, 2.4 GHz, 512MB cache 2 x Pentium Xeon 2.4 GHz, 512MB cache running the 2.4.18 kernel with Hyper- Memory 1GB 2GB Threading enabled on the system. Note the Disk 60GB, 7,200 RPM, Ultra ATA 100 2 x 72GB, 10,000 RPM SCSI four CPU states indicated as CPU0-CPU3 on top. Also note that CPU0 is running at 100.1% Table 3 Comparison of Windows XP Pro and Red Hat Linux 7.3 utilization – wow, Hyper-Threading is cool!

38 August 2003 www.JavaDevelopersJournal.com ©2003 Wily Technology, Inc. The Wily logo is a trademark of Wily Technology, Inc. Java is a trademark of Sun Microsystems in the U.S. and other countries.

Two years without a vacation. I’m to blame. Steve’s to blame. Not any more. Get Wily.™ Enterprise Java The application’s up. It’s down. Someone’s always to blame. Application Management It’s up. It’s down. 1 888 GET WILY www.wilytech.com Threaded Benchmarking on HT and Non-HT Systems Our goal here is to understand the effects of Hyper- Threading processors on the performance of multithreaded Java applications. To do this, we need a test bed that will allow us to execute heavily threaded operations and track performance variations against thread count in HT and non- HT systems. Thread Bench Design At a basic level, the test bed should be able to execute Figure 1 SMT vs non-SMT processor architecture multiple operations across n threads, observing the total throughput of operations per unit of time for a run. On a • Initialization of operations on the JIT: Modern JIT compil- dual-processor system, we should see nearly double the per- ers will optimize “hot spots” in the code. The performance J2SE formance on a CPU-intensive operation using two threads of any given operation will improve over the life of the VM, instead of one. The performance of CPU-intensive threaded so the ThreadBench framework gives operations a chance operations on HT systems will vary based on the operations to initialize on the JIT before the tests commence. and the level of concurrency possible on a single physical • Operation abstraction: By developing a generic operation processor. interface and using dynamic class loading and initializa- Our focus here is to explore which types of operations will tion of the operation to be tested, we can quickly proto- and will not benefit from HT technology. Given this we need type and test various processor-intensive operations. J2EEto be able to quickly J2ME implement and test multiple types of • Test suites: Using test suites, ThreadBench runs a given operations. operation configuration through several iterations of the There are several Java benchmarking systems available on test with different numbers of threads. This allows a series the market. Many are older and focused on applet perfor- of tests to be repeatedly run on several machine configura- mance. Some newer benchmark systems like VolanoMark or tions with minimal effort. SPECjbb2000 test the threaded performance of systems; • Multiple runs: To smooth out anomalies in the test, each however, they don’t allow us to customize and focus on spe- data point is created by averaging data from several runs. cific individual operations that could affect performance on This is configurable; some tests have a larger standard OME

H an HT system. deviation than others. These requirements drove the design and coding of an n- thread Java benchmark framework. The framework supports The code for this article can be downloaded from the JDJ pluggable operation classes and produces plottable results Web site, www.sys-con.com/java/sourcec.cfm. for a range of thread counts from a single test suite execu- tion. Factors Affecting Performance Figure 4 presents a functional/UML diagram for the sys- Use of Threads tem design. This seems obvious; however, it needs to be mentioned: The resulting benchmarking framework has the following single-threaded applications (often client applications) will features: see little performance gain. Server-side Java applications make extensive use of threads, making them excellent candi- dates for performance improvement from SMT. Nonthreaded applications may still see some benefit. Java’s garbage collection and background JIT compilers operate as daemon threads in the local JVM. In addition, concurrent processes could make use of the additional processor resources.

The Operating System’s Thread Scheduler In an HT system, a single physical processor is presented to the OS as two logical processors. This requires the OS to differentiate between physical and logical processors and make intelligent decisions about thread scheduling. Figure 2 MS Windows XP on a dual-processor system with HT The thread scheduler on a dual-processor HT system will see four logical processors. A poor thread scheduler could schedule two CPU-intensive threads onto separate logical processors representing the same physical processor. This would result in a perceived performance decrease on an HT- based system.

CPU Resource Utilization Hyper-Threaded processors do not duplicate all available resources. Two threads performing fundamentally similar operations on separate logical processors will likely see little performance gain. For HT to be a benefit, the two threads coexisting on a physical CPU must perform a variety of oper- Figure 3 Linux on a Red Hat 7.2, 2.4.18-3 HT system ations to allow the processor to make better use of latency.

40 August 2003 www.JavaDevelopersJournal.com

“Single-threaded applications (often client applications) will see little performance gain”

Performance of Threaded Benchmarks on HT To simulate this, a Gaussian elimination algorithm with and Non-HT Systems scaled partial pivoting and back substitution is used (see Tests were run on two HT-capable dual-processor systems Figure 5). A full matrix is constructed of random doubles J2SE (see Table 3). using Math.random(). The population of the matrix is carried Hyper-Threading requires BIOS support, making it easy out in the setup() method and is not considered part of the to enable and disable the feature in the boot setup program operation. for various runs. This operation carries out large numbers of simple float- Each test was run with the Sun JDK 1.4.1_02, using the ing point operations on doubles. All calculations are done in –server flag on the Linux and XP systems. Tests were also run the Java call stack, though it’s highly likely that the code was with the IBM 1.4.0 JVM, with no command-line flags, on the optimized by the JIT before the tests were run. J2EELinux system. J2ME It seems that this operation does not scale well into threads The tests devised are by no means comprehensive. The on any JVM. The Sun VM on Microsoft with Hyper-Threading goal was to stress the processor, using different processor does significantly worse than the Linux JVMs with or without resources, to try to gain some insight into the effects of SMT Hyper-Threading. There are no synchronizations in the opera- processing. The series of tests was run on each of the above tion whatsoever. Poor scaling into threads could be due to systems, with and without HT enabled. Each of the operation memory barriers, or contention for a bus or main memory. algorithms tested is briefly described, followed by results and some discussion and interpretation. Test 2: Calculation of 2000! (Integer intensive) OME

H Note: To save space, the XP and Linux tests are shown on Calculation of factorial (! operator) is used often in proba- the same plots. The data should not be directly compared, bility calculations. It’s used as a portion of the formula for however. The tests were run on different physical hardware, combinations and permutations. Factorial is defined as fol- indeed the processor speeds on the XP machine were higher lows: than on the Linux machine. N! = 1 x 2 x 3 x 4 x … x N

Combinations are an interesting calculation in poker, and illustrate a potential use of the factorial operator. To calculate the number of five-card combinations in a 52-card deck, we use the combinations formula: 52! Possible poker hands= 52C5 = 5! .(52-5)! Factorial calculations of even small integers grow rapidly, requiring the use of the java.math.BigInteger class. Calculations of factorials result in a large number of integer multiplications. The factorial calculations shown in Figure 6 do show some consistent, limited benefit from Hyper-Threading. Indeed, for four threads the IBM JVM shows a 17% increase in performance using an HT-enabled system. Incidentally, there are 2,598,960 five-card combinations in a 52-card deck. Figure 4 Pseudo UML for the threaded benchmark framework Test 3: 150K calculations of Math.tan() (Floating point, mixed stack) Test 1: Gaussian Elimination, 500x500 matrix This test simply calculates the tangent of an angle 150,000 (Floating point intensive) times in a tight loop (see Figure 7). Gaussian elimination is a very common algorithm used to All Java threads have two call stacks: one for Java calls, the solve systems of linear equations – a common task in finite ele- other for C calls. The java.lang.Math.tan(double) function is ment applications, weather simulation, coordinate transforma- native, calculating an approximation of tangent with a 27th tions, and economic modeling among other things. Algorithmic order polynomial. It’s likely that the reason this operation optimizations are often done for sparse/banded matrices; how- scales so well into Hyper-Threading is the constant call stack ever, the core of the work is fundamentally the same – large switching, giving the processor time to utilize its secondary numbers of floating point calculations are required. thread context.

42 August 2003 www.JavaDevelopersJournal.com www.LinuxWorld.com

The Leading Magazine for Enterprise and IT Management

Regular features SAVE 30% LinuxWorld include: Advice on Linux Infrastructure OFF! Magazine Detailed Software Reviews REGULAR ANNUAL COVER PRICE $71.76 There is no escaping the penetration of Linux into the corporate world. Traditional models are being Migration Advice YOU PAY ONLY turned on their head as the open-for-everyone Linux bandwagon rolls forward. Hardware Advice Linux is an operating system that is traditionally held in the highest esteem by the hardcore or geek $ 99 developers of the world. With its roots firmly seeded in the open-source model, Linux is very much born CEO Guest Editorials from the “if it’s broke, then fix it yourself” attitude. 49 12 ISSUES/YR Recruiting/Certification Advice Major corporations including IBM, Oracle, Sun, and Dell have all committed significant resources and *OFFER SUBJECT TO CHANGE WITHOUT NOTICE money to ensure their strategy for the future involves Linux. Linux has arrived at the Latest News That Matters boardroom. SUBSCRIBE Yet until now, no title has existed that explicitly addresses this new hunger for information from Case Studies the corporate arena. LinuxWorld Magazine is aimed squarely at providing this group with the knowledge TODAY! and background necessary to make decisions to utilize the Linux operating system. Look for all the strategic information required to better inform the community on how powerful an alternative Linux can be. LinuxWorld Magazine does not WWW.SYS-CON.COM feature low-level code snippets but focuses instead on the higher logistical level, providing advice on hardware, to software, through to the recruiting of trained OR CALL personnel required to successfully deploy a Linux-based solution. Each month presents a different focus, allowing a detailed analysis of all the components that 1-888-303-5282 make up the greater Linux landscape.

FOR ADVERTISING INFORMATION: CALL 201 802.3020 OR VISIT WWW.SYS-CON.COM

LINUXWORLD¨ IS THE REGISTERED TRADEMARK OF INTERNATIONAL DATA GROUP, INC. SYS-CON IS USING THE MARK PURSUANT TO A LICENSE AGREEMENT FROM IDG The World’s Leading i-Technology Publisher Figure 5 Gaussian elinination test Figure 7 Target calculation test J2SE J2EE J2ME

Figure 6 Factorial test Figure 8 Prime number search test

Test 4: Prime number search Sun 1.4.1, Windows XP Pro A prime number search operation was created using the Threads Gauss Factorial Math.tan() Prime OME

H BigInteger class and a very simplistic direct search factoriza- 1 -0.51% 0.93% 0.62% -1.32% tion. The poor algorithm is not as important as the type of 2 -1.18% 0.98% -6.17% 14.07% calculations being performed. This class performs a large 3 -12.90% 3.53% 7.85% -0.74% number of BigInteger divisions. 4 -23.96% 4.61% 11.74% -24.14% It is difficult to tell what is going on in Figure 8, beyond the 6 -23.23% 6.35% 11.79% -23.46% fact that the IBM JVM is beating Sun’s. The IBM JVM scales 8 -23.66% -23.36% well into threading this operation. It does even better when Hyper-Threading is enabled. The Sun VM scales poorly into Conclusion threads, and it becomes worse with additional thread contexts. When I began this project, I fully expected to see marked You could speculate that this behavior is characteristic of a performance gains using Hyper-Threading over identical low-level synchronization contention issue in the Sun JVM. hardware not using HT. In the course of testing, I’ve learned quite a bit about performance differences for Java on various Testing Summary platforms, hardware configurations, and virtual machines. The plots above give some general idea of how these vari- Hyper-Threading is not the boon I had expected. In some sit- ous operations scale into threads. In most cases, the HT per- uations, performance gains for HT reached the 75% mark, formance gains are modest. The following is a summary of which is considerable. There was little significant perfor- performance differences seen with Hyper-Threading enabled mance degradation using HT, so using it seems to be largely versus disabled for each of the tested JVMs. on the upside. Perhaps the more important finding is that the IBM JVMs IBM 1.4.0, Linux 2.4.18 perform significantly better than the Sun JVMs. In addition, Threads Gauss Factorial Math.tan() Prime the IBM JVMs scaled far better with threads than did Sun’s 1 4.13% 3.92% -0.10% 3.06% offering. If performance is of key concern, and you’re not 2 1.92% 7.39% 1.62% -2.42% using some of the more esoteric features of the Sun JVM, IBM 3 0.21% 11.45% 34.99% 1.96% JVMs deserve serious consideration. 4 -2.58% 16.98% 75.84% 9.84% Most server-side Java applications are not doing compu- 6 -3.56% 13.33% 60.96% 4.53% tationally intensive tasks. The tasks focus more heavily on 8 -0.69% 2.41% socket IO – communicating with databases, clients via HTTP, RMI, Web services, and the like. Processors will be given Sun 1.4.1, Linux 2.4.18 plenty of socket IO wait time to schedule parallel tasks. For Paul Bemowski is an Threads Gauss Factorial Math.tan() Prime socket-IO-bound applications, be sure to consider the rela- independent consultant, 1 0.99% 0.28% -0.75% 0.30% tive skill of your operating system in the IP arena. focusing on Java solu- 2 -1.20% 0.35% -1.76% 6.10% The introduction of Hyper-Threading on desktop P4 sys- tions to enterprise com- 3 -2.20% 8.21% 23.76% 6.30% tems is also exciting. Java developers often develop on puting problems. 4 -3.63% 8.28% 62.74% -30.08% Windows or Linux-based desktop systems and deploy onto 6 -4.13% 7.71% 62.96% -27.50% larger SMP and potentially SMT systems. HT will allow a [email protected] 8 -4.73% -28.28% desktop developer and user to see some of the benefits of

44 August 2003 www.JavaDevelopersJournal.com threaded applications long before deployment to the higher- Intel Processor Specsheets end systems. • Xeon: www.intel.com/products/server/processors/serv- SMT technology is here to stay. Intel’s Hyper-Threading er/xeon/index.htm implementation is sure to be the first of many. Chip industry • Xeon DP: watchers speculate that Simultaneous Multithreading and www.intel.com/design/xeon/prodbref/index.htm thread-level parallelism will spell the ultimate end of the • Xeon MP: “megahertz wars.” A chip’s performance will be tied less to its www.intel.com/products/server/processors/server/xeon_ internal clock speed and more to the bells and whistles it mp/index.htm incorporates. Other chip manufacturers are sure to follow • Pentium 4: suit, and all implementations will improve in quality over http://developer.intel.com/design/pentium4/datashts/29 time. 8643.htm Operating systems are also continually improving their • P4 Chipset matrix indicating HT support: support for Hyper-Threading. It does seem strange that the www.intel.com/design/chipsets/linecard.htm performance on an XP system, which should be HT opti- • IBM Whitepaper on Linux and Hyper-Threading: www- mized, was often less HT friendly than the 2.4.18 Linux ker- 106.ibm.com/developerworks/linux/library/l- nel, which is HT ignorant. As more sophisticated support for htl/?dwzone=linux HT is built into operating systems, we should see more sig- • LinuxWorld article indicating Q4 2003 release of 2.6 Kernel: nificant performance gains using HT in the Java world. www.inuxworld.com/story/33805.htm The combination of Java and Linux in the datacenter is rapidly gaining ground on the Solaris/Java platform. The Glossary majority of these new Linux servers are running high-end • Physical processor: A silicon-based hardware processor Intel-based hardware. Hyper-Threading will give this trend a • Logical processor: A hardware/software system mak- further push in the Linux direction. ing pseudo-parallel use of a single physical proces- For now, given a piece of hardware that’s HT capable, the sor configuration that offers the best performance under most • Simultaneous Multithreading (SMT): The use of logical conditions is the IBM 1.4.0 JVM on Linux with Hyper- processors to increase processing throughput on a single Threading enabled. physical processor • Symmetric Multiprocessing (SMP): The use of multiple Resources physical processors in parallel, each running separate • Microsoft license clarification for SMT systems: threads of execution www.microsoft.com/nz/licensing/downloads/hyper_threa • Hyper-Threading: Intel’s marketing name for its SMT tech- ding_processors_licens ing_brief.doc nology on Xeon and Pentium 4 processors

www.JavaDevelopersJournal.com August 2003 45 J2ME INSIGHT

Glen Cordrey

J2ME J2ME Editor Sun Addled

’m just back from vacation, and after from a hazelnut to a coconut, and in a six days of sun on the beach in the few years I expect to have one book- Practical morning and on the tennis court in shelf devoted just to all of the editions Integration of the afternoon, sun addled is a good of this book that I’ve acquired (yes, I Java-Oriented description of my frame of mind. could throw out the old editions, but Technologies I Also account for liberal quantities of then I’d have to transfer all of the high- and 2.5/3G beer throughout the week, and I’ll be lighted items and dog-ears from the Platforms happy if I’m somewhat coherent in old editions to the current one). this editorial. I’m also in a post-vaca- If you don’t keep abreast of the latest tion funk, so forgive me if I wax changes by reading technical journals philosophical while I strive for and making frequent book purchases J2EE J2SE coherency. you can quickly find your skills becom- 48 The vacation’s one of the reasons I ing, if not obsolete, certainly in far less didn’t go to JavaOne this year – it demand. If you’re content to specialize would have been hard to justify two in a single area – say, JSPs or EJBs – you weeks off so close together, and this can save yourself some of this, but then time play won out over work. On some you limit yourself career-wise, and you occasions work and play have mixed won’t experience the satisfaction of Sun Addled without undue harm to either – I’ve architecting larger solutions. OME

H written J2ME code while on a ski vaca- Of course, change is part of what I think that the rate of tech- tion in Tahoe and on vacation in the keeps our work interesting, and keep- 46 Caribbean – but that was due to ing abreast of these changes helps give nical change in our industry puts extraordinary circumstances (the roll- you the hot skills that bring in the out of the first J2ME cellphones in the bucks. But trying to keep up with developers at a real risk of early U.S.). This vacation was completely what’s coming out from Sun can leave burnout. Alvin Toffler wrote that disconnected from the Internet – I you Sun addled. Add in a desire to intentionally left my laptop home, and keep current in object-oriented analy- “Future shock [is] the shattering my cell phone was for emergency calls sis and design, UML, design patterns, only. I’m a bit of a Luddite in that I and the full complement of related stress and disorientation that we don’t want to be connected and avail- technologies, plus the pervasive “need able 24x7, and don’t spend large it yesterday” mentality of modern induce in individuals by subject- amounts of my free time playing with organizations, and you can easily feel the latest gee-whiz gadgetry. There are overwhelmed. ing them to too much change in a lot of other things to do in life, and You really can’t expect to know you only get one shot at it (reincarna- everything about everything in the too short a time.” As a Java tion notwithstanding). technologies we deal with, so know I think that the rate of technical when to go full bore and when to developer you may sometimes change in our industry puts developers throttle back. As The Specials (and at a real risk of early burnout. Alvin many before them) sang, “enjoy your- feel that you’re experiencing Toffler wrote that “Future shock [is] the self, it’s later than you think.” If the shattering stress and disorientation alternative is getting so burnt out that such future shock. that we induce in individuals by sub- you end up considering a career jecting them to too much change in change, wouldn’t you rather chill out too short a time.” As a Java developer every now and then by sipping a you may sometimes feel that you’re Corona on a beach somewhere? experiencing such future shock. If • • • Glen Cordrey is a software you’ve been in the Java business for In last month’s editorial I surveyed architect working in the more than a few years, consider the the MIDlet marketplace. Fortuitously, Washington, DC, area. He’s been changes that you’ve seen in that time. next month’s issue of JDJ will contain using Java for five years, New APIs proliferate like rabbits – an article by Greg Schwartz that takes developing both J2EE and J2ME XML, JAXB, SOAP, CLDC, MIDP, JDK you through the process of actually applications for 1.4, the list goes on and on. At 992 getting your MIDlet published via vari- commercial customers. pages, the current issue of Java in a ous outlets. So if you’ve thought about Nutshell is over twice the size of the selling MIDlets, keep an eye out for [email protected] first edition. This nutshell has grown this article.

46 August 2003 www.JavaDevelopersJournal.com SaturdaySessions

We understand the pressures of work and how difficult it can be to get time off. That is why we have designed this workshop to be held in one day and, as a special Alan Williamson JDJ Editor-in-Chief bonus, on the weekend, so no days off from work. Your boss will be happy!

M T W T F S S Coming to you... May: June: NEW YORK ATLANTA DALLAS BOSTON Performance > Efficiency > Reliability

This one-day intensive workshop is designed for What you will receive...

developers who wish to increase the efficiency ✓INTENSIVE ONE-DAY SESSION and reliability of their code development. DETAILED COURSE NOTES AND ✓EXCLUSIVE ONLINE RESOURCES The day will begin by looking at the various hints and tips you can utilize at the code ✓JDJ CD ARCHIVE 1)level to improve the quality and reduce the number of bugs you have to contend with.

The next part will look at Apache’s Ant and how you can use this freely 2)available tool for your own development, irrespective of your IDE. ONLY $ Last, and most important, as the old saying goes: “You can never do enough * testing.” This session will look at JUnit and show you how to start building test 295 3) *JDJ subscribers harnesses for your code so you can begin your testing strategy. ( $395 non-subscribers ———————————————————) *GROUP DISCOUNTS >Performance Java is a powerful language. While it offers a rich array of tools, the fundamentals mustn’t be overlooked. AVAILABLE Improving your code at the core layer will result in great improvements in efficiency and produce (hopefully) less bugs. We’ll look at the do’s and don’ts of programming and learn many hints and tips that will accelerate your Java coding.

>Efficiency with Ant To Register Apache’s Ant is a powerful scripting tool that enables developers to define and execute routine software development tasks using the simplicity and extensibility of XML. Ant provides a comprehensive mechanism for www.sys-con.com/education managing software development projects, including compilation, deployment, testing, and execution. In addition, it is compatible with any IDE or operating system. Call 201 802-3058 > Reliability with JUnit A critical measure of the success of software is whether or not it executes properly. Equally important, however, is whether that software does what it was intended to do. JUnit is an open-source testing framework SPONSORED BY that provides a simple way for developers to define how their software should work. JUnit then provides test runners that process your intentions and verify that your code performs as intended. The result is software that not only works, but works in the correct way.

PRODUCED BY PRESENTED BY

ALL BRAND AND PRODUCT NAMES USED ON THIS PAGE ARE TRADE NAMES, SERVICE MARKS, OR TRADEMARKS OF THEIR RESPECTIVE COMPANIES. J2ME

ware specifically built to implement client and service aspects of a solution. Since developers are no longer restricted to “thin-client” approaches, components installed directly within wireless devices have greater access to device features, sensors, and actuators. Clearly, developers will need access to a new generation of end-to-end tools that work within an open, universal tools integration platform. These will help address the special needs of multi-language, multi-platform,

J2EE J2SE and multi-vendor development environments. The challenge is to combine flexibility and broad functionality with the demands for very limited memory, processing, and battery power. 3G handsets will be built on a component base that provides the robust and reliable platform on which applications can be hosted. 3G is where the phone world meets the computing world. Voice communication will continue to be central while multimedia, OME

H secure e-business transactions, and data services will provide differentiation. A 3G handset will need to have the same relia- bility as a phone, but the same functionality as a computer, and still be small and power efficient. Let’s use an example to illustrate the reality of merging voice, data, and communications onto modern-day devices (cellphones, PDAs, and handheld computers) and enabling a road new dynamic e-business application model. A technician on ranges of a service call uses a handset to view a full-motion video on deployment choic- how to remove a part from a photocopier. Using the same es are available to devel- handset, the technician submits an order for the part and opers as they engage in new receives verification that the part has been reserved for his B projects that will leverage the power of customer. Using location-based services, the server applica- wireless communication platforms. While tion, determining that there is a delivery van with the part on deploying services through third-generation (3G) and board in the neighborhood, uses a cellular SMS message to second-and-a-half generation (2.5G) wireless terminals divert the driver to the technician’s location. presents challenges that are quite different from those As applications are extended to mobile devices, new tech- encountered in personal computers and servers, many famil- nologies will be required to provide productivity to the end iar environments have been adapted to resource-constrained users while shielding them from the inherent complexities of devices. integrating local and remote services. Local services such as This article discusses the practical integration of Java-ori- bar code scanning, scalable vector graphics, full-motion ented technologies and 2.5G/3G platforms and what you video, and voice navigation will be required on the device. need to know when dealing with resource constraints and Remote services residing within the service infrastructure, the management of software components through develop- such as location-based (GPS), transactional, and messaging ment, testing, deployment, and maintenance. services, will need to be accessed wirelessly by the device. Communication handsets already offer functions similar All these technologies exist today. To successfully inte- to those available on desktop computers, including Internet grate and deploy them on a constrained handset is a “simple access. While handheld devices are becoming more capable matter of programming.” To get there faster requires two and powerful with each generation of products, they contin- things: the right platform and the right tools. ue to be resource constrained compared to their desktop The role of Java in these systems is hidden from the end brethren. Limited amounts of memory, processing, and bat- user, but it will play an important role for the developers of tery power are realities for the wireless developer. the wireless terminals and infrastructure equipment. These hardware limitations must be compensated for by smart application development and tight middleware integra- Next Generation Communication Systems tion. Rather than just acting as browsers for reformatted Web What are the reasons for using Java in 3G/2.5G termi- content, 3G handsets have the potential to host application soft- nals and infrastructure? Java will be successful within the

48 August 2003 www.JavaDevelopersJournal.com A LIMITED TIME SAVINGS OFFER FROM SYS-CON Media

RECEIVE YOUR DIGITAL EDITION SUBSCRIBE TODAY ACCESS CODE INSTANTLY WITH YOUR PAID TO MULTIPLE MAGAZINES SUBSCRIPTIONS AND SAVE UP TO $400 AND 3-Pack RECEIVE UP TO 3 FREE CDs! Pick any 3 of our magazines and save up to $27500 Pay only $175 for a 1 year subscription plus a FREE CD • 2 Year – $299.00 • Canada/Mexico – $245.00 • International – $315.00 6-Pack Pick any 6 of our magazines and save •Choose the Multi-Pack you want to order by checking Pick a 3-Pack, a 6-Pack or a 9-Pack $ 00 TO next to it below. •Check the number of years you want to ■ 3-Pack ■ 1YR ■ 2YR ■ U.S. ■ Can/Mex ■ Intl. up to 350 order. •Indicate your location by checking either U.S., ■ 6-Pack ■ 1YR ■ 2YR ■ U.S. ■ Can/Mex ■ Intl. ORDER Canada/Mexico or International. •Then choose which Pay only $395 for a magazines you want to include with your Multi-Pack order. ■ 9-Pack ■ 1YR ■ 2YR ■ U.S.■ Can/Mex ■ Intl.

■ Linux World Magazine ■ WebLogic Developer’s Journal 1 year subscription U.S. - Two Years (24) Cover: $143 You Pay: $79.99 / Save: $63 + FREE $198 CD U.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CD U.S. - One Year (12) Cover: $72 You Pay: $39.99 / Save: $32 U.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31 plus 2 FREE CDs Can/Mex - Two Years (24) $168 You Pay: $119.99 / Save: $48 + FREE $198 CD Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CD Can/Mex - One Year (12) $84 You Pay: $79.99 / Save: $4 Can/Mex - One Year (12) $180 You Pay: $169 / Save: $11 • 2 Year – $669.00 Int’l - Two Years (24) $216 You Pay: $176 / Save: $40 + FREE $198 CD Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CD Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $180 You Pay: $179 / Save: $1 • Canada/Mexico – $555.00 ■ Java Developer’s Journal ■ ColdFusion Developer’s Journal • International – $710.00 U.S. - Two Years (24) Cover: $144 You Pay: $89 / Save: $55 + FREE $198 CD U.S. - Two Years (24) Cover: $216 You Pay: $129 / Save: $87 + FREE $198 CD U.S. - One Year (12) Cover: $72 You Pay: $49.99 / Save: $22 U.S. - One Year (12) Cover: $108 You Pay: $89.99 / Save: $18 Can/Mex - Two Years (24) $168 You Pay: $119.99 / Save: $48 + FREE $198 CD Can/Mex - Two Years (24) $240 You Pay: $159.99 / Save: $80 + FREE $198 CD Can/Mex - One Year (12) $84 You Pay: $79.99 / Save: $4 Can/Mex - One Year (12) $120 You Pay: $99.99 / Save: $20 Int’l - Two Years (24) $216 You Pay: $176 / Save: $40 + FREE $198 CD Int’l - Two Years (24) $264 You Pay: $189 / Save: $75 + FREE $198 CD Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $132 You Pay: $129.99 / Save: $2 9-Pack ■ Web Services Journal ■ Wireless Business & Technology U.S.- Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CD U.S. - Two Years (24) Cover: $144 You Pay: $89 / Save: $55 + FREE $198 CD Pick 9 of our U.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14 U.S. - One Year (12) Cover: $72 You Pay: $49.99 / Save: $22 Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CD Can/Mex - Two Years (24) $192 You Pay: $139 / Save: $53 + FREE $198 CD Can/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6 Can/Mex - One Year (12) $96 You Pay: $79.99 / Save: $16 magazines and save Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 up to $40000 ■ .NET Developer’s Journal ■ WebSphere Developer’s Journal U.S. - Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CD U.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CD U.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14 U.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31 Pay only $495 for a Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CD Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CD Can/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6 Can/Mex - One Year (12) $180 You Pay: $169 / Save: $11 Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CD 1 year subscription Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $180 You Pay: $179 / Save: $1 ■ XML-Journal ■ PowerBuilder Developer’s Journal plus 3 FREE CDs U.S. - Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CD U.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CD • 2 Year – $839.00 U.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14 U.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31 Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CD Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CD • Canada/Mexico – $695.00 Can/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6 Can/Mex - One Year (12) $180 You Pay: $169 / Save: $11 Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CD • International – $890.00 Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $180 You Pay: $179 / Save: $1

OFFER SUBJECT TO CHANGE WITHOUT NOTICE Subscribe Online Today www.sys-con.com/2001/sub.cfm communication segment for the same reasons it’s success- The Right Platform – Not All J2ME Implementations ful in the IT segment: (1) time-to-market through produc- Are Created Equal tivity, and (2) flexibility and stability through open stan- J2ME is a direct response to the recognition that not all dards. devices are created equal. It provides a means for defining Shifting market demographics, global competition, and various device classes and a minimum level of capability and significant development and maintenance costs have rein- services that can be guaranteed on compliant devices. It does forced the need for increased flexibility and productivity. No not, however, specify how well those services will perform.

J2ME one application or service is going to meet all needs, and as a The devil is in the details of the platform’s design, functional- result service providers must have the ability to quickly and ity, and implementation – how the individual components of efficiently deploy new applications. This drives the funda- the platform, the RTOS, and the virtual machine are designed mental idea of building a general platform with predefined and implemented, what capabilities they have, and collec- capabilities and shared services that can be configured in tively how they are integrated. real time with applications and add-ons, resulting in differ- entiable end products. The J2ME specifications provide a General Performance definition of such a platform for devices of varying capabili- Footprint and Memory Costs ties. Developing applications according to these J2ME speci- One of the largest costs in a 3G handset is the memory. fications: Designing a device with loads of expensive RAM and high- • Ensures application compatibility and portability with performance flash is not an option for many manufacturers. device capabilities The right platform will be based on software specifically • Reaps the productivity benefits of the Java programming designed from the ground up to be small, scalable, and con- model and accessibility to a continually growing base of figurable, not carved down from an enterprise implementa- skilled developers tion.

J2EE J2SE • Simplifies the integration of applications and services that The RTOS plays an important role in saving memory, not reside in both the handset and infrastructure sides of the only by providing a scalable, small footprint solution, but wireless link also by implementing memory-conserving features such as: • Limiting the amount of RAM consumed during execution Selecting the best J2ME implementation is important, as • Preventing memory fragmentation it’s the implementation of the “platform” – the underlying • Supporting persistent memory types and enabling flash real-time operating system (RTOS) and virtual machine – memory to function as the work memory, including that provides to a varying degree: “instant-on” execute-in-place (XIP) features that allow OME

H • A safe and secure programming environment that protects platforms to execute code directly from the flash memory the system from faulty add-ons that could corrupt the sys- without prior loading into a RAM buffer tem • Supporting dynamic remapping of applications’ memory • A layered software design with isolation mechanisms pages between RAM and flash that prevent direct access to hardware and RTOS servic- es Building on a strong RTOS, J2ME platforms at the sim- • A fast and reliable execution environment with minimal plest level assist in reducing the memory footprint for small memory consumption and efficient power usage that devices by specifying the set of services available to an appli- enables applications to take full advantage of available cation on a compliant platform. This allows these services to hardware resources in order to produce high quality ser- be implemented once and then be shared by each applica- vice tion. In the wireless domain this also means improved per- • Tested and certified, not just compatible, implementation formance as only the application, not the core services, need against the J2ME specifications’ “Java-powered” runtime to be deployed over the wireless connection. environment At a deeper level, developers also need to look at the over- • An extensible platform for connecting applications all memory of an application as it runs on the device. Some deployed on the handset with data and applications within virtual machines grab small amounts of memory up front (to the infrastructure reduce the initial footprint), and incrementally grab memory • Runtime downloading (and unloading) capabilities of both as it’s needed (costing in terms of speed). Others grab more Java applications and native system components memory up front, but less over time (up front memory hit, • Efficient and intuitive programming tools for all of the but faster over time). The ideal solution is a virtual machine above that is customizable and tunable. With J9, the virtual machine inside WebSphere Micro Environment, initial and In the following section, OSE Systems and IBM describe incremental memory heap space can be set to meet the spe- how the integration of RTOS and J2ME-certified runtimes cific service needs and device capabilities. can be optimized for the wireless handset market. Finally, once the application has been designed and opti- Experience is taken from their recent efforts in integrating mized, there are benefits to be realized in how it is deployed OSE Systems’ RTOS OSE and IBM’s WebSphere Micro to the device. Depending on the type of application and the Environment. characteristics of the device, it may be more beneficial to Development took place in an integrated tools platform execute the application out of flash rather than RAM. This with development tools based upon the open source Eclipse could be to minimize RAM requirements or to provide the platform, an open universal tools integration environment. application with an “instant-on” capability. Development tools that are powered by Eclipse technology such asIBM’s WebSphere Device Developer (an offering Execution specifically targeted to embedded platforms) are also dis- The execution speed of applications on these consumer cussed as examples of the tooling needed for embedded Java handsets will continue to be an important success factor. applications. Java applications have previously suffered a bad reputation

50 August 2003 www.JavaDevelopersJournal.com because of their interpretive nature. While it’s true that inter- nents, digital coding and decoding of voice, the relationship preters will generally run slower than compiled applications, with base stations, and setup facilities that connect and dis- the difference at the application level is not necessarily connect calls. Moving to 3G handsets will not change the noticeable; in situations where it is noticeable, there are opti- requirement for deterministic real-time behavior. Users will mized runtime options such as ahead-of-time (AOT) and not accept calls suddenly being disconnected or the other just-in-time (JIT) compilation. party’s voice sounding slow and distorted. Just-in-time (JIT) compilation is a runtime option that The challenge will be to keep today’s excellent perform- uses a compiler within the virtual machine to translate Java ance and reliability, while introducing the new services that bytecodes into native machine language for a specific device. high-speed, packet-based data transmission enables. For A cache of memory contains compiled machine language multiple Java applications to coexist in a resource-limited prepared “just in time” for use. Execution of recurring byte- device, the Java runtime environment needs deterministic codes is then handled directly from the machine language in real-time behavior. cache. After the initial “compilations,” JIT technology The design of the virtual machines has also moved for- improves performance at the cost of increased memory and ward to allow for deterministic execution. One specific area start-up time. is in the garbage collection of the virtual machine. To illus- Ahead-of-time (AOT) compilation is an option that con- trate, the IBM J9 virtual machine inside WebSphere Micro verts Java bytecodes into native machine language for the Environment has the following features to assist in the devel- specific device at deployment time. Unlike JIT, compilation opment of deterministic applications. occurs on the development host. The result can be packaged • Real-time systems need to recover memory efficiently. “ahead of time” into a compact executable for direct loading Look for features such as precise garbage collection (GC) and execution within the virtual machine environment. AOT as opposed to conservative garbage collection. GC should compilation can be extremely effective when applied selec- also be incremental, so the virtual machine is not locked tively to application hotspots. It can provide near JIT per- during GC. formance without the start-up time penalty and at a fraction • In the most serious of deterministic cases, GC should also of the memory costs. allow interrupts. This stops GC immediately so critical The J9 virtual machine was designed first and foremost to events can be processed at the highest possible priority. An interpret bytecodes quickly. Building on this strong founda- example of this would be receiving an incoming phone call tion, the JIT and AOT compilers provide the application while gaming. developer with options for managing the speed versus mem- ory cost trade-off. The significance of this flexibility is con- Having a virtual machine implement deterministic func- siderable given that the J9 virtual machine can execute appli- tions has limited value if the underlying RTOS does not pre- cations deployed as bytecodes, AOT or JIT compiled machine dictably implement real-time elements. Operating systems code, and, most important, any combination of the three. such as OSE are an example of a true embedded real-time system, designed from the ground up for demanding needs Application Security and Continuity like determinisms, reliability, and robustness. Besides the While ensuring reliability of standalone software applica- classical features such as preemptive scheduling, lightweight tions, it’s equally important to design a device with system processes, small footprint (measured in tens of kilobytes), robustness in mind. Downloaded applications and services scalability, efficient interrupt handling with short interrupt cannot be allowed to corrupt the system. Separation of sys- latency, and an interrupt-centered device driver model, there tem-critical and noncritical software is essential and the are other features to look for in an RTOS: operating system in the device should provide isolation • Message-based architecture to ensure ease-of-use, high mechanisms and memory protection for this purpose. For performance, advanced debug capabilities, transparent example, in the case of OSE’s dynamic loading/unloading IPC in distributed systems, and memory-protected sys- capabilities of native software (C/C++), special protection tems mechanisms have been introduced to ensure that loaded • Memory management with a focus on performance even modules will be memory protected when taking advantage of when using low-performance memory types, efficient pre- a hardware MMU. vention of memory fragmentation, and multiple memory Introducing a Java runtime environment that takes pools to allow robust system design advantage of the RTOS’ inherent security in a 3G handset has • Automatic error handling with a multilayered error han- the great benefit of providing a secure and protected envi- dler approach ronment for application software, which is often written in • Process supervision and automatic resource cleaning, Java. The handset’s native environment (C/C++) that controls which enables a system to be self-recoverable the device will be protected from the Java application envi- ronment. In system architectures that would benefit from The Right Tools – The Java Developer Is Efficient greater separation, multiple virtual machines could exist on As the 3G handset becomes a deployment platform with- the handset and can be started and stopped independent of in an overall pervasive computing context, tools to manage each other. In addition, when the RTOS supports native run- the end-to-end project life cycle will be needed. It will be time downloads, even new, updated Java Virtual Machines customary to establish new development relationships as can be dynamically installed after a handset is produced and part of these projects. Often several companies or depart- deployed. ments will need to collaborate on solutions that deploy across deeply embedded controllers, handsets, personal Deterministic Real-Time Behavior computers, servers, and even mainframe systems that handle Deterministic real-time behavior is a requirement in millions of devices concurrently. The development life cycle today’s 2G mobile phones. To wirelessly deliver your voice to starts with managed requirements, then progresses to mod- any location in the world within fractions of a second, 2G eling, code development, debugging, installation and man- platforms include software that must control radio compo- agement tasks, and testing. Testing takes on new aspects as www.JavaDevelopersJournal.com August 2003 51 multiple handset platforms, deployment networks, Web ser- executables vices servers, and service providers must be accommodated. • Wizards that package an application for execution out of Tools that manage all of these aspects of project develop- flash memory (XIP) ment and deployment must integrate together well if devel- • Wizards for packaging applications for deployment within opers are to progress efficiently. an OSGi or enterprise side service As in the device runtime discussion, it will be important • Ability to seamlessly create new custom tool features or to for the Java and native (C/C++ and assembler) tooling envi- integrate new or better tool capabilities from third-party

J2ME ronments to be well integrated. Being able to switch between providers task-aware freeze-mode and run-mode debugging is impor- tant in real-time systems as certain bugs cannot be found There are a large number of competing and comple- unless parts of the system can execute while others are mentary operating platforms and middleware technology frozen. offerings available. New project and business relationships Traditional source code debugging needs its complement may mean that a developer needs to bridge between multi- in system-level debugging where events can be traced and ple tools and collaboration environments. Since projects analyzed, and design flaws can be found. Advanced system- will often need to address additional deployment environ- level debugging is possible when the system design is based ments, including creating and managing metadata for on a message-passing architecture with automatic resource complex middleware, multiple compatible development cleaning, like OSE enables. Profiling of the CPU and memory offerings may need to be considered. When an open, usage as well as postmortem debugging are other needed extendable integration framework like Eclipse is the basis debugging tools. The OSE Illuminator debug tool suite is for tools, it becomes easier to accommodate multiple-plat- implemented in Java, which provides for easy integration form, multiple-language, and multiple-vendor develop- with a Java development environment like Eclipse-based ment tasks.

J2EE J2SE WebSphere Studio Device Developer. Part of the challenge for developers working to deploy While Java’s portability and productivity benefits are well solutions across server and wireless handset platforms known, tooling designed for the embedded developer will involves collaboration and team coordination. A universal need to provide several features above and beyond those tools integration platform like Eclipse is equally at home in found in a simple IDE. Real productivity is achieved with the supporting a variety of development languages (Java, AspecJ, following: C/C++, Cobol, and Smalltalk, for example) and a broad range • The ability to develop and debug in both on-host emula- of enterprise and embedded deployment platforms. Eclipse tion environments and the actual on-device environment supports all these environments through common access to OME

H • The ability to develop and debug mixed mode, Java, and modeling tools, testing environments, and concurrent access C/C++ applications to multiple source code repositories. Several vendors are now • Execution analysis tools that operate on the device and offering solutions that integrate their areas of specialization highlight application bottlenecks by profiling memory, with the Eclipse platform. stack and thread usage, and priorities Offerings like QNX Momentix and TimeSys TimeStorm • Setup and configuration wizards that ensure applications use the same Eclipse platform and provide speciality tools for are developed against the desired J2ME configuration or working with QNX Neutrino and TimeSys Linux in C and C++ profile and for the desired target hardware language environments. Source code control and manage- • Wizards for recommending which portions of the applica- ment offerings from Computer Associates (All Fusion), MER- tion should be compiled as Java bytecodes, AOT, or JIT ANT (PVCS), Rational (XDE), Borland (Together Control Center), MKS (Source Integrity), Serena (Workbench), LogicLibrary (Logidex Asset Expert), Eclipse (CVS), Starbase Eva Skoglund is a product marketing manager for wireless systems for OSE Systems, a real-time (StarTeam), Telelogic, and Instantiations (CodePro Studio) let operating systems company. She holds an MS in computer science from the Royal Institute of you plug in access to a variety of VCM and source code man- Technology in Stockholm. agement systems. Offerings like IBM’s WebSphere Studio Application Developer extend Eclipse to include visual edi- tors, development of enterprise services, middleware access, and more. Organizations like Quest Software, Parasoft, Bryan Hartlen works in business development, product marketing, and IP licensing areas and JUnit.org, and Scapa Technologies have provided test exten- manages IBM’s family of embedded Java products. Previously, he developed or managed soft- sions. ware developers on platforms that ranged from mainframe applications to shop floor control systems to PCMCIA cards. Summary 3G handsets will need to combine phone reliability and real-time requirements on small and resource-constrained devices with ever-changing application functionality. J2ME Marc Erickson has been a key participant in several international innovations from IBM includ- specifications provide definitions of general platforms for ing workflow technology and service support center development. He is now on assignment as devices of varying capabilities and will serve as the basic the communications manager for Eclipse. software building blocks for these devices. Successful imple- mentations of the J2ME platform will require an RTOS and Java runtime environment that focus on deterministic real- time behavior and low memory usage. Successful projects Angus McIntyre is the director of business development for embedded technology at IBM and will need to efficiently integrate and work with tools from has spent his entire career on application development tools (OTI, IBM Canada Lab, VisualAge multiple vendors for multiple development and deployment for Java, VisualAge Micro Edition). He holds a BS in computer science and statistics and an platforms and in multiple languages. The combination of MBA. J2ME technology and Eclipse-based tools is the key to power- ful solutions.

52 August 2003 www.JavaDevelopersJournal.com How JDJ’s CirculationCirculation CComparesompares to the Competition‘s... 116,665* ...Now that they were finally able to file their December 2002 Circulation Statement :-)

65,170*

JDJ THE COMPETITION

With JDJ, Reach 79%9% MoreMore Java Professionals!

*DECEMBER 2002 BPA AUDIT STATEMENTS

Carmen Gonzalez Senior VP, Sales & Marketing

Contact | Carmen Gonzalez: [email protected] or 201 802.3021 SHOW REPORT

The Spring 2003 Rocky Mountain Software Symposium Tom Marrs ‘No Fluff, Just Stuff’ J2SE

ecause today’s software development One of the highlights of the confer- one of his JAAS presentations, Maciej climate is so fiercely competitive, only ence was the keynote – “Introduction to Zawadzki provided the inside scoop on those developers, architects, and tech- Pragmatic Programming” by Dave Urbancode’s EJB Benchmark – he created nical managers who meet the needs of Thomas. This session showed the ineffi- a series of benchmarks to prove to his J2EEtheir clients and embrace J2ME change can ciencies in today’s software development clients that Entity EJBs were needlessly B hope to survive. The “No Fluff, Just practices and what could be done about slow, and that alternate solutions would Stuff” (NFJS) conference series them. We experience the same problems perform and scale better. (www.nofluffjuststuff.com) covers the today that we had back in the 1970s and latest in industry developments and ’80s. Projects are still late, underfeatured, Conclusion best practices with cutting-edge ses- over budget, and full of bugs. Dave cited When I asked attendees for their sions and panel discussions on an NIST study that showed how the U.S. opinions of the conference, the consen- Java/J2EE, XML, open source, and agile wastes $60 billion each year on buggy sus was: OME methodologies. In this review, I discuss software. Since there are about 3–4 mil- • They gained valuable insights from H my experiences at the recent Spring lion developers in this country, each the sessions that they could apply to 2003 Rocky Mountain Software developer costs the U.S. economy rough- their daily work. Symposium (RMSS), held from Friday, ly $20K each year – ouch! • Their time wasn’t wasted with vendor May 16, through Sunday, May 18, in Pragmatic programming fits some- product demos. Denver. where between methodologies and • They enjoyed interacting with recog- The speaker list for the Spring 2003 technology-specific skills. It is not a nized industry experts. RMSS reads like a “who’s who” in the methodology; it’s about the individuals • The conference schedule over the Java/J2EE/open source community. For and teams who produce software. weekend didn’t interrupt their sched- the complete lineup, please visit Pragmatic programming breaks down ules. www.nofluffjuststuff.com/2003-05-den- into three practice areas: individual, • It was less expensive and easier to ver/speakers.jsp. I attended sessions technical, and team. attend a local conference than hav- given by: The most distinctive feature was the ing to travel. • Sue Spielman: Author of The Struts section on individual practices: • The conference was a good value for Framework: Practical Guide for • Learn continuously: Read books, go the price. Programmers and the forthcoming to conferences, and interact with • The conference CD contained all the JSTL: Practical Guide for JSP other developers at user groups. presentations. Programmers • Fix broken windows: Fix problems as • James Duncan Davidson: Creator of soon as they occur to keep them Since I learned so much in just one Jakarta Tomcat and Apache Ant from growing larger. weekend, I would recommend an NFJS • Bruce Tate: Author of Bitter Java and conference to any developer, architect, lead author of Bitter EJB Speaker Interaction or technical manager looking to keep • Dave Thomas: Author of The The speakers were personable and up with the latest trends and improve Pragmatic Programmer: From helpful. After presenting on “Effective their skills. I plan to attend this confer- Journeyman to Master Enterprise Java: Systems,” Ted Neward ence when it returns to Denver in the • Erik Hatcher: Author of Java spent a long time with me discussing fall because the NFJS symposium series Development with Ant ClassLoaders, their relationship to the truly lives up to its billing – “No Fluff, • Maciej Zawadzki: Creator of the JVM, and how this relates to Singletons in Just Stuff.” AntHill build management server a J2EE environment. In between sessions, and author of Urbancode’s EJB Sue Spielman spoke with me about the Tom Marrs is the principal/senior software architect at Benchmark ups and downs of writing a technical Distributed Computing Solutions, Inc., based in Denver. His • Ted Neward: Author of Server-Based book, and compared being a solo author focus is on building J2EE system architectures and mentor- Java Programming and the forth- to working with other authors. During ing developers in J2EE, OO, XML, and Web services tech- coming Effective Enterprise Java breakfast, Bruce Tate gave me ideas on nologies. • Glenn Vanderburg: Principal with how to become more marketable in Delphi Consultants today’s challenging IT economy. After [email protected]

54 August 2003 www.JavaDevelopersJournal.com PRESSROOM

Industry News J2ME

Aplix, Rococo Partner for Java- Patent-Pending Type 4 JDBC Drivers Java components for the large software Bluetooth Platform Providing Single Sign-on systems targeted by the Navy’s Open

(London) – Java specialist Aplix is join- (Rockville, MD) – DataDirect Architecture Computing Environment J2SE ing with Bluetooth vendor Rococo Technologies, a provider of compo- (NOACE). The purpose of Navy Open Software for an integrated Java- nents for connecting data and applica- Architecture (NOA) is to evolve Navy Bluetooth platform targeted at mobile tions, has announced DataDirect surface ship warfighting systems from phone OEMs and integrators. Connect for JDBC 3.3, the first set of the current status quo toward a unified The alliance will enable mobile Type 4 JDBC drivers to support Navy product line composed on a com- phone manufacturers to implement a Windows authentication. DataDirect mon computing environment (e.g., single, integrated solution for Java- Technologies has implemented NOACE), a common set of warfighting Bluetooth technology support in Windows authentication within their functions shared across many platforms, Aplix’s JBlend Java Virtual Machine Type 4 JDBC components used for con- and unique sets of warfighting functions J2EE (JVM) environment. The companies necting Java applications to Microsoft associated with each ship class. will jointly market and sell the plat- SQL Server data. DataDirect www.newmonics.com form. Technologies has a patent pending on www.aplixcorp.com this new technology. Thor Technologies Teams with Oracle www.rococosoft.com www.datadirect-technologies.com (San Francisco) – Thor Technologies,

Inc., a provider of secure enterprise H Introduces Mainframe-Scale Panscopic Application provisioning and an active member of OME Java Solution for Windows Version 2.3 Released the OraclePartnerNetwork, has (Blue Bell, PA) – Unisys Corporation has (San Francisco) – Panscopic, a provider of announced the immediate availability announced the availability of Java J2EE self-serve reporting, has announced of new Xellerate adapters for Oracle Virtual Machine (JVM) for ES7000 the availability of version 2.3 of the Internet Directory, the identity reposi- servers, a Java computer platform that Panscopic Application. New features tory for the Oracle9i platform. The takes advantage of Microsoft’s operat- include XML data access and transforma- combination of these technologies ing environments. Now enterprise solu- tion capabilities via integration with gives organizations a comprehensive tions created with Java software tech- BEA’s Liquid Data, the ability to build ad solution for effectively managing user nology can tackle workloads that once hoc reports using any existing query or identities and access rights to heteroge- could be handled only by expensive report, and integration with Microsoft neous enterprise systems and applica- Unix-based servers by applying the 32- Excel, enabling enterprise data to be tions. The result for enterprises is processor scalability of the Unisys accessed from native Excel spreadsheets. streamlined identity management ES7000. This new Unisys JVM can be www.panscopic.com capabilities and reduced administra- downloaded from the Internet free of tion. Thor is also a featured Oracle9i charge. Wily Integrates Introscope with IBM Application Server partner. www.unisys.com WebSphere Application Server 5.0 www.thortech.com (Brisbane, CA) – Wily Technology Strategic Focus Compares Developer has announced the direct inte- BEA WebLogic Platform 8.1 Ships Productivity Using Business Process gration of Introscope, Wily’s (San Jose, CA) – BEA Systems, Inc., has announced the general availability Management Software and Java IDE Enterprise Java Application of BEA WebLogic Platform 8.1, WebLogic (Milpitas, CA) – Strategic Focus, a busi- Management solution with IBM Workshop 8.1, WebLogic Integration 8.1, ness strategy and software evaluation WebSphere Application Server 5.0 and WebLogic Portal 8.1. BEA WebLogic consulting firm, has completed a study for z/OS and OS/390. Introscope Platform 8.1 and each individual product, that compares the developer productiv- assists enterprises in the deploy- including the previously available WebLogic ity of building applications with busi- ment and management of main- Server 8.1 and WebLogic JRockit 8.1, can ness process management (BPM) soft- frame Java applications that meet be downloaded now from www.bea.com, ware and a traditional Java develop- the highest demands for per- or customers can receive the ment environment. Strategic Focus formance and reliability. development versions of the built a BPM application in each of the www.wilytech.com products at no charge for one two development environments (BPM year as part of the BEA and Java IDE) following identical speci- NewMonics Wins Navy dev2dev subscription pro- fications, then measured the time Contract for Hard gram. BEA’s new products needed to complete each phase of the Real-Time Java are based on a unique soft- software life cycle. A free copy of the (Tuscon, AZ) – NewMonics, Inc., ware architecture developed by BEA, all based on Java 2 Enterprise Edition 17-page white paper can be down- was awarded a U.S. Navy con- (J2EE), extensible mark-up language (XML), and emerging Web services loaded from www.pega.com or tract to implement the integra- standards. www.strategicfocus.com. tion of hard and soft real-time www.JavaDevelopersJournal.com August 2003 55 LABS

OneInterSystems Memorial Drive Corporation Cambridge, MA 02142 USA Web: www.intersystems.com Phone: 617-621-0600 Caché 5 E-mail: [email protected] Reviewed by Mathias Kühn & Specifications by InterSystems Corporation Christian Och Platforms: Windows 95/98/ME, Windows 2000 Pro/2000 Server/2000 Adv. Server, Windows XP J2SE Home/Pro, Mac OS X, Linux, HP/UX, Solaris, IBM AIX, Tru64, OpenVMS Pricing: $200 in a single-user version and starting at $1,000 for a multi-user configuration ne of the key challenges facing Java rapid application development (RAD) developers is that their object-oriented of complex systems and applications. Test Environment applications use data stored in relation- With Caché 5, InterSystems delivers a al databases. The result: time- and cost- powerful, high-performance, massively Notebook ASUS L3800 with Mobile Intel Pentium J2EEintensive mapping J2ME between the two scalable database system that supports P4 processor, 40GB disk, 1GB RAM O paradigms. InterSystems’ Corporation a plethora of standard protocols, pro- Operating Systems: Windows 2000 Pro with develops and markets a post-relational gramming languages, and middleware Service Pack 3/SuSE Linux 8.1 database management system called technologies. Caché that’s designed to address this challenge by eliminating the imped- Ready, Set, Go! guage, you can also use Caché Basic, a ance mismatch between objects and For our evaluation, we used the close relative to Visual Basic. tables. Windows and Linux versions of Caché. OME We set out to test the capabilities of In both cases, we used the single-user What’s Behind the Scenes? H this database software from a Java license that can be freely downloaded The heart of Caché is its multidi- developer’s perspective. Working with from InterSystems’ Web site. The instal- mensional data engine with a robust the latest release of the software, Caché lation process took only a few minutes storage system that provides outstand- 5, we found the results impressive. and not even the Windows system had ing transactional performance and is Caché’s unique combination of to be restarted. All other tools and tech- capable of serving very large data vol- objects and SQL provides a very inter- nologies are installed along with the umes. Equipped with transactional esting development framework for database system, and the Web server bitmap indices, queries are evaluated object-oriented programmers that goes (Internet Information Server or in fractions of a second without sacri- far beyond what pure relational or pure Apache) is reconfigured to incorporate ficing update and insert performance. object-oriented databases provide. Caché’s Web gateway. In addition, the multidimensional Besides eliminating the impedance After the installation, we started the data model of Caché avoids time-con- mismatch between objects and tables, Caché Studio (see Figure 1), the devel- suming mapping operations between Caché’s unified data architecture allows opment environment used for editing objects and relations because data is the classes stored in Caché, and imme- natively stored in Caché’s multidimen- diately began to create some classes. sional storage. The Unified Data Using the integrated wizards, you can Architecture (UDA) provides access to easily create classes with all the fea- the stored data and delivers the neces- tures available in Caché. Programming sary metadata information to the rela- Caché’s internal language, ObjectScript, tional or object-oriented client. In gen- is very easy, especially if you are used to eral, there’s no difference if the data is coding in Java or JavaScript. If Visual accessed in a relational manner or Basic is your favorite programming lan- through objects. Caché and Java Our primary focus was on testing the Java features provided by Caché. With three different ways of connecting to Java, Caché provides optimal sup- port for Java developers and program- mers. Data stored within Caché can be accessed with SQL via JDBC, and Caché classes can be projected either as Java classes or as Enterprise JavaBeans. Java developers directly gain data persis- tence without a lot of tedious coding.

56 August 2003 www.JavaDevelopersJournal.com The JDBC driver is installed along Summary Snapshot with the database and is fully compli- We were impressed by Caché’s per- ant with the JDBC standard. To access a formance, features, and ease of use. We Target Audience: Java programmers, database Caché class in an object-oriented man- were both very satisfied with our test developers ner, all we needed to do was specify results and plan to take an even closer Level: All levels that it should be projected to Java. This look at Caché and its technologies. Note Pros: “projection” then automatically gener- that a more detailed review of Caché, • Combines the object-oriented and the rela- ated Java binding classes that could including several code examples, may be tional paradigm, eliminates the need for an easily be incorporated into Java appli- found on our Web site (www.synerva OO-relational mapping cations. The great advantage of projec- .com). As with any software product, • Easy installation and maintenance, no high- tions is that the binding classes are there are some trade-offs. In this case, the skilled administrator necessary automatically generated every time a main one is the learning curve that devel- • Outstanding performance with a small mem- class is modified and recompiled. So opers who are only familiar with relation- ory footprint the programmer is relieved of the cum- al database technology must overcome in • Support for different Java technologies to bersome and error-prone process of order to take full advantage of Caché. access the database (JDBC, Caché object bind- keeping the database schema and the InterSystems has done everything they ing, EJB) application bindings up-to-date. can to ease the transition by providing a • Support for a plethora of technologies and For J2EE application servers, we development environment that has a standards only had to specify an EJB projection familiar look-and-feel and surprisingly • Embraces common Java standards (Streams, and Caché created entity beans with complete and usable documentation, but Collections, JDBC, etc.) either bean-managed persistence the curve still exists. Also, there are appli- Cons: (BMP) or container-managed persist- cation areas such as data warehousing • No support for polymorphic function signa- ence (CMP). In contrast to the simple where market gorillas with traditional tures Java projection that creates a single relational technology will continue to • EJB-, Object-, and JDBC-binding in one JAR file Java class, the EJB projection generates dominate for the foreseeable future. all necessary classes for an EJB entity Caché is worth a very close look. bean, a deployment descriptor, a deployment command file, and even a Mathias Kühn is a Java developer and software architect at little servlet for testing the created SYNERVA, an IT service company for software development, con- bean. We tested Caché’s EJB support sulting, and training with a special focus on the realization of with a standard installation of JBoss 3.0 complex, distributed information systems (www.synerva.com). and did not experience any difficulties. In addition to JBoss, Caché also directly [email protected] supports the WebLogic and the Pramati application servers and automatically Christian Och is an IT consultant at SYNERVA and has over 10 creates all necessary configuration files years of experience as a software architect and project leader for the specific server. Other J2EE-com- in the areas of heterogenous database integration, distributed pliant application servers should also object technologies, and application development. work with Caché without any prob- lems. [email protected]

Figure 1 The Caché Studio www.JavaDevelopersJournal.com August 2003 57 JSR WATCH From Within the Java Community Process Program

A more open and transparent process Onno Kluyt

elcome to the August edition of the JCP instead of the ME EC or the SE/EE EC. And one by Oracle and one jointly by Oracle J2SE column! This month I’ll cover a few J2ME- finally, JSR 215 outlines default require- and IBM. related JSRs and two new JSRs in the ments for TCKs at the Final Approval JSR 225, XQuery API for Java, will J2SE/J2EE environment, but first out of the Ballot. If all goes well from the time of my enable a Java application to submit block is the program office’s own JSR, writing, JSR 215 should be in Community XQuery queries to an XML data source W number 215. Review and you should be able to view and and process the results of such queries. provide feedback on the draft process doc- XQuery is an effort by the W3C XML Further Evolving Rules of the ument at http://jcp.org/jsr/detail/215.jsp. Query Language Group. While there are Community The Executive Committee members and I APIs such as JDBC, JDO, and RowSets J2EEJSR 215 aims to deliver J2ME several changes are very interested in hearing your opin- to process relational data, there is no to the rules of the JCP to make the process ions on these proposals. common API to query XML data. more open and transparent, both to mem- JSR 227, submitted by Oracle, is bers and to the general public. These The J2ME Environment titled “A standard data access and data Onno Kluyt is the changes should make it easier to deter- In the J2ME environment there are a binding facility for J2EE”. This propos- director of the JCP mine how a JSR is doing and what the couple of items of note to share with al introduces declarative bindings, a Program expert group is working on. The plan is to you. JSR 185 successfully passed its Final framework of classes that formalize Management Office, make all draft reviews publicly visible, Approval Ballot. The goal of the JTWI the typical interactions between UI OME Sun Microsystems. including the Community Review. The JSR specification is to improve the compati- components and the values and H may also introduce the spec lead’s choice bility, interoperability, and completeness methods available on Business onno@jcp,org to have its JSR assigned to both ECs of J2ME technology implementations in Services so that any Java UI rendering mobile phones. The JSR mini- technology can declaratively bind to mizes API fragmentation and these services. A Business Service is a raises the bar of functionality Java class that publishes and manipu- for high volume devices in this lates the objects that represent an market. enterprise application’s persistent Nokia has submitted a new data sources. JSR that aims to deliver an optional API for scalable 2D JavaOne Conference Postscript vector graphics. Two examples The JCP program was quite active at of target use for the API are map this year’s conference. At the “Java visualization and scalable icons. Communities in Action” event where JSR 226 plans to support the you could compare and contrast JINI, W3C Scalable Vector Graphics JXTA, and the JCP, the program office (SVG) format and is aimed at an handed out the first JCP awards. The MIDP 2.0 environment. EC members voted Nokia the Most Since the time of writing of Innovative J2ME JSR for JSR 184, BEA last month’s column, several the Most Innovative J2SE/J2EE JSR for J2ME-related JSRs faced recon- JSR 207, and Jim Van Peursem of sideration ballots (JSRs 177, 216, Motorola the Best Spec Lead. Jim is the 217, 218, 219). Each JSR success- spec lead for JSR 118, an expert group fully passed the ballot, meaning of 60+ companies with more than 120 they are approved to progress to persons participating, and the JSR still the next step in the process. If delivered! you’re interested in the com- During the conference I did the ments submitted by EC mem- usual number of press interviews. In bers while voting, visit a JSR’s closing, I’ll share with you my favorite page on JCP.org and click on the question from one of these interviews: ballot link in the status table. “Now that Java has Web services APIs, why do you still have RMI?” On to the J2SE and J2EE That’s it for this month. I am very Environments interested in your feedback. Please e- The last few weeks saw the mail me with your comments, ques- submission of two new JSRs, tions, and suggestions.

58 August 2003 www.JavaDevelopersJournal.com International Web Services Conference & Expo Web Services Edgeg 3rd Annual Delivering .NET,JAVA, Mac OS X, & XML Technologies

2003 WEST REGISTER TODAY! CALL 201-802-3058 www.sys-con.com SEPT.30 - OCT.2,2003 Register before August 1st and Santa Clara, CA SAVE Up To $300

Produced and Presented: Media Sponsors: Web Services EdgeWEST 2003

WEB SERVICES EDGE SEPT.30 - OCT.2,2003 CONFERENCE & EXPO Santa Clara Convention Center

t is our pleasure to bring the latest edition of the highly successful Web Services Edge Conference & Expo to the Santa Clara Convention Center, September 30 – October 2, 2003. The Third Annual Web Services Edge West Conference & Expo will continue to build on our Ipast success to make available the most current and relevant information to you, our valued attendee. With the widespread adoption of Web services across the industry, developers are facing new challenges. In this year's conference program, we will address these challenges with our most comprehensive program to date. Web Services Edge 2003 West will provide practical approaches and solutions to overcome the hurdles in developing and deploying Web services in today’s competitive markets. Once again Web Services Edge will feature dedicated tracks covering Java, Web Services, .NET, and XML - along with the newly added Mac OS X Track. Sessions in this track will highlight the use of the Mac OS X platform, which combines the ease of use of a Mac with the power of Unix, in applications and Web services development, deployment, and management.

Your three days will include highly informative keynotes, conference sessions, tutorials, industry-leading university certification programs, case studies, and demo presentations. The Expo Hall will be open on September 30 and October 1, featuring the largest grouping of quality exhibitors prepared to field your questions and solve your development needs.

All the best, SYS-CON Events

HIGHLIGHTED SPEAKERS

3 Days Packed with Education and Training Allan Vermeulen CTO, Amazon.com Keynotes & Panel Discussions from Industry Leaders CTO and vice president at Amazon.com directly oversees the 60 Hard-hitting and Informative Seminars Platform Technologies group. This group is responsible for guiding FREE .NET Tutorial with Russ’ Tool Shed Amazon.com's technology architecture, including building and Java University Certification Training acquiring foundational components. Prior to his move to Industry-Leading Certification Programs Amazon.com, Vermeulen was CTO and vice president of development at Rogue Wave Software. He holds a PhD in Systems Design Engineering from the “Birds of a Feather” Discussions University of Waterloo. Round Table Discussions Opening Day Welcome Reception John Schmidt SAMS Meet the Authors Hot Topics Lounge Leader of Systems Integration and Middleware, Best Buy Co. John Schmidt is the chairman of the Methodology Committee for the Compelling Case Studies & Best Practices EAI Industry Consortium and leader of systems integration and mid- Hands-On Labs dleware at Best Buy Co., a leading specialty retailer of consumer elec- Featured Product Demonstrations tronics, personal computers, entertainment software, and appliances. Exhibit Floor featuring more than 40 companies and hundreds of products Dave Chappell TO ALL CONFERENCE & EXPO REGISTRANTS VP,Chief Technology Evangelist, Sonic Software Real-time SYS-CON Radio Interviews Dave Chappell is the vice president and chief technology evangelist FEATURES ATTRACTIONS & FEATURES for Sonic Software. He has more than 18 years of industry experience building software tools and infrastructure for application developers, spanning all aspects of R&D, sales, marketing, and support services. Dave has also been published in numerous technical journals, and is currently Software Developer writing a series of contributed articles for Java Developer’s Journal. Software Engineer Anne Thomas Manes Development Manager Research Director, Burton Group Application Developer Anne Thomas Manes is a research director at Burton Group, a Technical Director research, consulting, and advisory firm. Anne leads research Analyst/Programmer for the Application Platform Strategies service. Named one of NetworkWorld's “50 Most Powerful People in Networking” in 2002, and IT Manager one of Enterprise Systems Journal's “Power 100 IT Leaders” in 2001, Anne is a

ATTEND Technical Architect renowned technologist in the Web services space. Anne participates in standards Team Leader development at W3C and OASIS. She is a frequent speaker at trade shows and author

WHO SHOULD Software Consultant of numerous articles and the book Web Services: A Manager's Guide.

Register Online at @ www.sys-con.com @ Web Services EdgeWEST 2003

WEB SERVICES EDGE SEPT.30 - OCT.2,2003 CONFERENCE & EXPO Santa Clara Convention Center

WEB SERVICES TECHNOLOGY JAVA TECHNOLOGY Presentations will include discussions of security, interoperability, the role of The Java Track features presentations aimed at the beginner, as well as the UDDI, progress of the standards-making bodies, SOAP,and BPM. Case studies seasoned Java developer. Sessions will explore the whole spectrum of Java, cover the design and deployment of Web services in the marketplace. focusing on J2EE, application architecture, EJB, and J2ME. In addition the track will cover the latest in SWT, Ant, JUnit, open source frameworks, as well Sessions will focus on: as an in-depth look into the vital role that Java is playing in building and Interoperability deploying Web services. Enterprise Networks Web Services Management Sessions will focus on: Web Services Standards Enterprise Java 1.4 Web Services Orchestration Ant Applied in “Real World” Web Services Security (WS-Security, SAML) Developing Application Frameworks w/SWT BPEL4WS Empowering Java and RSS for Blogging UDDI: Dead or Alive? JUnit: Testing Your Java with JUnit ebXML & Web Services JDK1.5: The Tiger EAI & Web Services Simplifying J2EE Applications RPC vs Documents: Uses Using IBM’s Emerging Technologies Toolkit (ETTK) and Differences Apache Axis User Interfaces for Web Services Meeting the Challenges of J2ME Development Web Services Best Practices Integrating Java + .NET Service Oriented Architecture Squeezing Java

XML TECHNOLOGY .NET TECHNOLOGY Presentations will focus on the various facets of XML technologies as they are Presentations will explore the Microsoft .NET platform for Web services. To applied to solving business computing problems. Sessions will include the average developer, it represents an entirely new approach to creating soft- emerging standards in XML Schemas, XML repositories, industry applications ware for the Microsoft platform. What’s more, .NET development products - of XML, applying XML for building Web services applications, XML/XSLT/ such as Visual Studio .NET - now bring the power of drag-and-drop, GUI- XQuery-based programming using Java/.NET, XML databases, XML tools and based programming to such diverse platforms as the Web and mobile devices. servers, XML-based messaging, and the issues related to applying XML in Sessions will focus on: B2B/EAI applications. The XML Track is geared for audiences ranging from ASP.NET beginners to system architects and advanced developers. Security Sessions will focus on: VB.NET XML Standards & Vocabularies XML .NET and XML Introduction to XForms Smart Device Extensions for VS.NET Securing Your XML and Web Services Infrastructure Best Practices XQuery Fundamentals: Key Ingredient to Enterprise Information Integration Shared Source CLI XML and Enterprise Architecture: Technology Trends .NET Remoting Standards-Based Enterprise Middleware Using XML/Web Services Smart Devices in Health Care Settings XML and Financial Services Mobile Internet Toolkit Canonical Documents for Your Business: Design Strategies ROTOR XPath/XSLT 2.0: What’s New? Portable .NET XML Schema Best Practices ASP.NET Using Mono XML in EAI, Enterprise Portals, Content Management Using WSE with IBM’s WSTK GUI applications Using Mono Portals – Windows SharePoint Services/SharePoint Portal Server MAC OS X Windows Server 2003 and IIS 6 OS X represents a new wave of operating systems. It combines the ease of use of .NET and Java Interoperability a Mac with the power of Unix. Sessions in this track will highlight the use of the Distributed .NET for Financial Applications Mac OS X platform in applications and Web services development, deployment Developing C# with Eclipse and management.

Sessions will focus on: Introducing OS X (Panther): What's New? Quick Applications using AppleScript Enterprise Java and OS X Developing Web Services Using WebObjects Xserve: Ease of OS X and Power of Unix Introducing Quartz: 2D Graphics for Apple OS X for the Unix Developer Securing OS X Applications Java and OS X: A Perfect Marriage Programming Rich User Interfaces Using Cocoa For more information visit www.sys-con.com or call SPECIAL Take advantage of the Early Bird and Pre-registration values available right now, or save DISCOUNTS even more with a group of 5 or more. For special group discounts contact Michael Lynch 201802-3069 AVAILABLE at [email protected], or by phone at (201) 802-3058. PRODUCED BY Conference at-a-Glance JAVA .NET WEB SERVICES XML 8:00AM – 4:00PM REGISTRATION

Enterprise Java 1.4 Using WSE 2.0 Web Services Management Introduction to Xforms 9:00AM – 9:50AM DAY 1

10:00AM – 10:50AM Opening Keynote - Allen Vermeulen, CTO, Amazon.com

11:00AM – 6:00PM EXPO OPEN

2:00PM – 2:50PM Keynote Panel Discussion - Enterprise Application Integration

Ant Applied in “Real World” Smart Devices in Health Care Settings Service Oriented Architecture Securing Your XML and 3:00PM – 3:50PM Web Services Web Services Infrastructure

XQuery Fundamentals: Key Developing Application Using the Mobile Internet Toolkit Web Services Orchestration Ingredient to Enterprise 4:00PM – 4:50PM Frameworks with SWT Information Integration

5:00PM TUESDAY, SEPTEMBER 30 TUESDAY, OPENING NIGHT RECEPTION

8:00AM – 4:00PM REGISTRATION Integrating Java and .NET Introduction to ROTOR Security (WS-Security, SAML) Standards-Based Enterprise Middleware Using XML/Web 9:00AM – 9:50AM Services DAY 2

10:00AM – 10:50AM Morning Keynote

11:00AM – 4:00PM EXPO OPEN

2:00PM – 2:50PM Keynote Panel Discussion - Interoperability: Is Web Services Delivering?

JUnit: Testing Your Java with JUnit Using Portable .NET WS-BPEL XML and Enterprise 3:00PM – 3:50PM Architecture: Technology Trends

JDK1.5: The Tiger ASP.NET with Mono UDDI: Dead or Alive? Using XML Schemas Effectively in WSDL Design 4:00PM – 4:50PM

Squeezing Java Using WSE with IBM's WSTK Web Services Choreography, Management, and Canonical Documents for 5:00PM – 6:00PM Security - Can They Dance Together? Your Business: Design WEDNESDAY, OCTOBER 1 WEDNESDAY, Strategies

8:00AM – 4:00PM REGISTRATION Using IBM's Emerging Technologies Toolkit Distributed .NET for Financial Applications eAI & Web Services XML and the Fortune 500 9:00AM – 9:50AM (ETTK)

DAY 3 Morning Technical Keynote 10:00AM – 10:50AM

Apache Axis Developing C# with Eclipse RPC vs Documents: Uses and XPath/XSLT 2.0: 11:00AM – 11:50AM Differences What’s New?

12:00PM BREAK

Meeting the Challenges of J2ME Windows SharePoint Services The Seven Habits of Highly Effective ebXML & Web Services 1:00PM – 1:50PM Development Enterprise Service Buses (ESBs)

2:00PM – 2:50PM Keynote Panel Discussion - Summit on Web Services Standards

Empowering Java and RSS for Blogging BizTalk 2003 See www.sys-con.com for more infor- See www.sys-con.com for 3:00PM – 3:50PM mation more information

See www.sys-con.com for more See www.sys-con.com for more information See www.sys-con.com for more infor- See www.sys-con.com for THURSDAY, OCTOBER 2 THURSDAY, 4:00PM – 5:00PM information mation more information FREE L MAC OS X Tutorial

Introducing OS X (Panther) What's New?

Programming Rich User Interfaces Using Cocoa RUSS’ TOOL SHED Join Russ as he shows you how to use Visual Studio .NET Quick Applications using AppleScript INTRO TO WEB SERVICES USING VS.NET One of the key ideas behind the .NET strategy is the concept of software as a serv- ice, or in short, Web services. This session will explain what a Web service is and provide an overview of its related technologies like XML, SOAP, and UDDI. We will demonstrate how the .NET Framework makes it easy to implement them for new and existing applications. This session will also provide concrete best practices for building XML Web services using Visual Studio .NET. We’ll answer many common questions like: How will my Web service scale? How can my XML Web services enable interoperability with Web services from other vendors as well as within my Java and OS X: A Perfect Marriage b own organization? We’ll delve into building highly reliable and secure Web services. Also, we will discuss issues such as dealing with complex data types using WSDL (Web Services Description Language), as well as securing SOAP messages using encryption. We’ll see how developers can use enterprise-level XML Web services to simplify customer solutions.

Enterprise Java and OS X

Developing Web Services Using WebObjects

ADVANCED WEB SERVICES USING ASP.NET Cocoa, Carbon, Java: Application Frameworks This session will explore some of the more advanced areas of SOAP in ASP.NET’s for OS X (When to use what) support for Web services. ASP.NET Web services are the preferred way for Web developers to expose Web services on the Internet. The goal is quick, easy, and high- performing SOAP services. We will look at how to use the SOAP extension classes to create some very interesting applications on top of the core SOAP architecture Securing OS X Applications found within the .NET Framework. For instance, you can implement an encryption algorithm or screen scraping on top of the Web service call. We’ll dig into more advanced topics, explore the SOAP headers, and see ways to ensure security in our Web services.

Xserve: Ease of OS X .NET REMOTING ESSENTIALS and Power of Unix Microsoft .NET Remoting is the .NET technology that allows you to easily and quickly build distributed applications. All of the application components can be on one computer or they can be on multiple computers around the world. .NET Remoting allows client applications to use objects in other processes on the same OS X for the Unix Developer computer or on any other computer to which it can connect over its network. During this presentation we will discuss what you will need to know to get started with .NET Remoting. We will talk about how .NET Remoting compares with DCOM, how to host remoted objects in a variety of applications, how to call remot- ed objects from a client application, how to control the lifetime of remoted Introducing Quartz: 2D objects, and how to secure remoting applications. Graphics for Apple

See www.sys-con.com for Register Online at more information www.sys-con.com

PROGRAM SUBJECT TO CHANGE REGISTRATION FORM

CONFERENCE: Sept. 30 – Oct. 2, 2003 EXPO: Sept. 30 – Oct. 1, 2003 4 A. Your Job Title Santa Clara Convention Center • Santa Clara, CA ❑ CTO, CIO, VP, Chief Architect ❑ Software Development Director/Manager/Evangelist THREE WAYS TO REGISTER FOR CONFERENCE ❑ IT Director/Manager ❑ Project Manager/Project Leader/Group Leader 1) On the Web: Credit Cards or “Bill Me.” Please make checks payable to SYS-CON Events. ❑ Software Architect/Systems Analyst 2) By Fax: Credit Cards or “Bill Me” 201-782-9651 ❑ Application Programmer/Evangelist 3) By Mail: 135 Chestnut Ridge Road, Montvale, New Jersey 07645, Attention: Registration ❑ Database Administrator/Programmer ❑ Software Developer/Systems Integrator/Consultant Please note: Registrations are not confirmed until payment is received. ❑ Web Programmer ❑ CEO/COO/President/Chairman/Owner/Partner Please complete sections 1, 2, 3 and 4 ❑ VP/Director/Manager Marketing, Sales ❑ VP/Director/Manager of Product Development 1 YOUR INFORMATION (Please Print) Mr. Ms. ❑ General Division Manager/Department Manager ❑ Other (please specify)______First Name ______Last Name ______B. Business/Industry Title ______❑ Computer Software ❑ Government/Military/Aerospace ❑ Computer Hardware and ❑ Health Care/Medical Company ______Electronics ❑ Insurance/Legal ❑ ❑ Street ______Computer Networking & Education WEST Telecommunications ❑ Utilities Mail Stop ______❑ Internet/Web/E-commerce ❑ Architecture/Construction/Real ❑ Consulting & Systems Integrator Estate City ______❑ Financial Services ❑ Agriculture State______Zip ______Country ______❑ Manufacturing ❑ Nonprofit/Religious ❑ Wholesale/Retail/Distribution ❑ Other (please specify) Phone ______❑ Transportation ______Fax ______E-Mail ______❑ Travel/Hospitality

(Payment in full due with registration) C. Total Number of Employees at Your Location and Web Web Services Edge 2003 2 PAYMENT METHOD: Entire Organization (check all that apply): Check or Money Order Enclosed (Registration confirmed upon receipt of payment) Location Company 10,000 or more 01 ❑ 01 ❑ Check #______Amount of Check $ ______5,000 - 9,999 02 ❑ 02 ❑ 1,000 - 4,999 03 ❑ 03 ❑ Charge my Visa MasterCard American Express Discover 500 - 999 04 ❑ 04 ❑ 100-499 05 ❑ 05 ❑ Name on card______100 or less 06 ❑ 06 ❑ D. Please indicate the value of communications and Card #______Exp. Date______computer products and services that you recommend, buy, specify, or approve over the course of one year: Signature______SEPT.30 - OCT.2,2003 ❑ ❑ Santa Clara Santa Convention Clara Center $10 million or more $10,000 - $99,999 ❑ ❑ Billing Address (if different from mailing address) $1 million - $9.9 million Less than $10,000 ❑ $500,000 - $999,999 ❑ Don’t know ______❑ $100,000 - $499,999

E. What is your company’s gross annual revenue? 3 PLEASE INDICATE Total Registration fee $______❑ $10 billion or more ❑ $1 million - $9.9 million YOUR CONFERENCE CHOICE Before 8/1/03 Before 9/26/03 Onsite ❑ $1 billion - $9.9 billion ❑ Less than $1 million ❑ GP Gold Passport Good for all three days of the .NET, $1,195.00 $1,395.00 $1,495.00 ❑ $100 million - $999 million ❑ Don’t know ❑ $10 million - $99.9 million Web Services, XML, Java, and Mac OS X Tracks, including Keynotes, Panel Discussions, preferred seating for Microsoft F. Do you recommend, specify, evaluate, approve or purchase .NET’s Russ’“Tool Shed” Tutorial, and your choice of one Sun wireless products or services for your organization? 01 ❑ Yes 02 ❑ No Microsystems Java™ University Class G. Which of the following products, services, and/or tech- nologies ❑ do you currently approve, specify or recommend the pur- 3D Three Day Conference $1,095.00 $1,295.00 $1,395.00 chase of? (Does not include Sun Java™ Education) ❑ Application Servers ❑ Web Servers ❑ 2D Two Day Conference (Does not include Sun Java™ $995.00 $1,195.00 $1,295.00 ❑ Server Side Hardware ❑ Client Side Hardware ❑ ❑ ❑ Education) (select any two days: Tue. Wed. Thurs.) ❑ Wireless Device Hardware ❑ Databases ❑ ™ 1D One Day Conference (Does not include Sun Java Education) $495.00 $595.00 $695.00 ❑ Java IDEs (select any one day: ❑ Tue. ❑ Wed. ❑ Thurs.) ❑ Class Libraries ❑ Software Testing Tools ❑ JU1 Sun Java™ University Class $595.00 $695.00 $795.00 ❑ Web Testing Tools Select one: ❑ Web Services Programming ❑ Modeling Tools ❑ Using Java™ Technology and XML (Sept. 30) Team Development Tools ❑ Installation Tools ™ ❑ Java Fast Path: Programmer (Oct. 1) ❑ Frameworks ❑ Java™ Fast Path: Architect (Oct. 2) ❑ Database Access Tools / JDBC Devices ❑ Application Integration Tools ❑ JU2 Sun Java™ University Class $1,095.00 $1,295.00 $1,395.00 ❑ Enterprise Development Tool Suites Select two: ❑ Web Services Programming ❑ Messaging Tools ❑ ™ Reporting Tools Using Java Technology and XML (Sept. 30) ❑ Debugging Tools ❑ Java™ Fast Path: Programmer (Oct.1 ) ❑ Virtual Machines ❑ Java™ Fast Path: Architect (Oct. 2) ❑ Wireless Development Tools ❑ XML Tools ❑ JU3 Sun Java™ University Class $1,195.00 $1,395.00 $1,495.00 ❑ Web Services Development Toolkits ❑ Select three: ❑ Web Services Programming Professional Training Services ❑ Other [Please Specify] Using Java™ Technology and XML (Sept. 30) ______❑ Java™ Fast Path: Programmer (Oct. 1) SYS-CON Events, Inc, and SYS-CON Media make no warranties regarding content, speakers, or attendance. The opinions of speakers, ❑ Java™ Fast Path: Architect (Oct. 2) exhibitors and sponsors do not reflect the opinion of SYS-CON Events WEB SERVICES EDGE CONFERENCE & EXPO and SYS-CON Media and no endorsement of speakers, exhibitors, ❑ EO Expo Only FREE FREE $50.00 companies, products, or sponsors is implied.

CANCELLATIONS, 2003, will be honored less a 20% handling Speakers, sessions, and schedule are subject to SUBSTITUTIONS, REFUNDS charge. No requests for refunds will be honored change without prior notice. Fax written request to SYS-CON Registration after September 12, 2003. Requests for substitu- If you require special assistance covered 201-782-9651. Requests for refunds received tions must be made in writing prior to No solicitation by anyone other than under the Americans with Disabilities Act, prior to August 29, 2003 will be honored, less a September 26, 2003. No one under 18 is official exhibitors, sponsors or marketing please call 201-802-3058 by 10% handling charge; requests received after permitted to attend. No warranties are made partners is permitted. Such behavior is cause for expulsion without refund. September 16, 2003. August 29, 2003, and before September 12, regarding the content of sessions or materials. Advertiser Index Next Month Advertiser URL Phone Page Asperon Corporation www.asperon.com 25 Extending JAAS Borland Software Corporation go.borland.com/j6 11 User authentication and access control are important security measures for Canoo Engineering AG www.canoo.com/ulc/ 41 61 228 94 44 7 most Java applications, especially J2EE applications. The Java Authentication and Authorization Service (JAAS), the core API of J2SE 1.4 and 1.5, represents Colorado Software Summit www.softwaresummit.com 16 the new security standard. This article will introduce the JAAS framework, iden- ESRI www.esri.com/mapobjectsjava 888-332-2320 9 tify the key components and their roles in the authentication and authorization process, and explain how the authentication and authorization perform. Fair, Isaac & Company www.fairisaac.com/rules Cover III

InetSoft Technology Corp. www.inetsoft.com/jdj 888-216-2353 17 Java and Stream Ciphers In the 1990s, I worked with the Winsock 2 Infotectonica www.infotectonica.com 34 interface and encryption when they first came Infragistics, Inc. www.infragistics.com 800-231-8588 14-15 out from Microsoft in Beta form; that was excit- ing as they allowed you to easily encrypt data InstallShield Software Corp. www.installshield.com/puzzlejdj 21 through the networks. When Java Sockets came out, I was hooked because the encryption could iSavix http://isavix.net 703-689-3190 41 be easily managed through a stream of data. LinuxWorld Magazine www.sys-con.com 888-303-5282 43 This article discusses streams from the cipher perspective and provides an example of Northwoods Software Corp. www.nwoods.com/go 800-434-9820 58 how to design and build a stream algorithm so you can practice proper techniques rather than Oracle oracle.com/switch 800-633-0538 4 relying on the technology to do it for you.

OracleWorld oracle.com/start 800-355-5808 35 Java Games Development Parasoft CorporationFPO www.parasoft.com/jdj08 888-305-0041 19 In Part 2 of this three-part series, the discus- sion focuses on the 85% portability goal for Java, Quest Software, Inc. http://java.quest.com/jclass/jdj 13 features of the Java platform that are a better choice for games development than other plat- Quest Software, Inc. http://java.quest.com/performasure/jdj 33 forms, and which features are missing from the Quest Software, Inc. http://java.quest.com/jprobe/jdj Cover IV API that are essential (or would just make life easier) for games development. RealObjects www.realobjects.com 23 Aligo Omni Mobile Platform RefactorIT www.refactorit.com 45 Way back in JDJ (Vol. 6, issue 11) I took a look at Aligo’s M-1 Mobile Application Server. ReportingEngines www.reportingengines.com/info/ere3.jsp 888-884-8665 24 Back then, the technology market was still in the Software FX www.softwarefx.com 27 heady “bubble” days and wireless was the next big frontier. Well, fast-forward to mid-2003 and Sonic Software www.sonicsoftware.com Cover II here we are wallowing in the throes of an extended technology slump. However, wireless SpiritSoft www.spiritsoft.com/climber 31 applications are still a part of the next big fron- WebAppCabaret www.webappcabaret.com/jdj.jsp 29 tier, and the team at Aligo has been hard at work updating their software. I recently got the Wily Technology www.wilytech.com 1-888-GET WILY 39 chance to get my hands dirty with the latest, forthcoming release of the Aligo Omni Mobile Web Services Edge West 2003 www.sys-con.com 201-802-3069 59-64 Platform.

Zero G www.zerog.com 415-512-7771 3 Cashing In: Distributing and General Conditions: The Publisher reserves the right to refuse any advertising not meeting the standards that are Marketing Your J2ME Killer App set to protect the high editorial quality of Java Developer’s Journal. All advertising is subject to approval by the Publisher. The Publisher assumes no liability for any costs or damages incurred if for any reason the Publisher You finally put the finishing touches on your fails to publish an advertisement. In no event shall the Publisher be liable for any costs or damages in excess of new J2ME application and are probably starting the cost of the advertisement as a result of a mistake in the advertisement or for any other reason. The Advertiser is fully responsible for all financial liability and terms of the contract executed by the agents or agen- to think about what is involved in marketing and cies who are acting on behalf of the Advertiser. Conditions set in this document (except the rates) are subject to distributing your killer app. It is at this point change by the Publisher without notice. No conditions other than those set forth in this “General Conditions Document” shall be binding upon the Publisher. Advertisers (and their agencies) are fully responsible for the con- that, all too often, great ideas are left as nothing tent of their advertisements printed in Java Developer’s Journal. Advertisements are to be printed at the discre- more than great ideas. From concept to con- tion of the Publisher. This discretion includes the positioning of the advertisement, except for “preferred posi- tions” described in the rate table. Cancellations and changes to advertisements must be made in writing before sumer, this article will explain all that is involved the closing date. “Publisher” in this “General Conditions Document” refers to SYS-CON Publications, Inc. in getting your application certified and distrib- This index is provided as an additional service to our readers. The publisher does not assume any liability for errors or omissions. uted by the world’s largest J2ME distributors.

www.JavaDevelopersJournal.com August 2003 65 FROM THE INSIDE Twenty-First Century Snake Oil Salesmen J2SE oftware is created by programmers who analysts and managers nervously guf- popular acceptance for Extreme write code, testers who try and break faw compliments like the emperor’s Programming (XP). This put the power the code before users do, and analysts subjects in the Hans Christian back into the hands of the coders and who are incapable of either task. Andersen fable. Data modeling testers who now deal directly with users, Analysts know this and like a congress- becomes trendy, methodologists and create the simplest code possible to get S man’s PR agent on their lunch break, process reengineers are hired, while the job done, and do it lots of times. they must constantly adapt to find new authors of expensive and pathetic XP gave me great hope that the ways to remain on the payroll. The hardback books dazzle gullible confer- overthrown analysts would become the J2EEanswer in IT is no different J2ME than any ence attendees who are mesmerized by Troy McClures of software develop- similar dilemma in which a person presentation foils like first year music ment, with perhaps a few survivors finds himself: bluff, fraud, and deceit. students at a John Cage concert. becoming electric tongue scraper sales- For inspiration, the analyst thinks None of this, however, helps users men on late night infomercials. With back to those days at school when he or get their software any sooner. It does this in mind, I recently attended a pres- she sat in science classes and gazed at have a noticeable advantage over cod- entation by a famous analyst “who shall complicated diagrams being drawn by ing, because analysis occurs at the start not be named” who began by saying the teacher. The kids who understood of a project where time and money are that in the past 10 years, misguided OME what the teacher was saying went on to plentiful and the enthusiasm of senior analogies between civil engineering H become proper engineers, while the management and users still exists. Just and software had created the mess we befuddled analysts instead picked up when coding is about to begin, the had all lived through. Waiting for him the subliminal message “complicated whole methodology landscape may to admit he played more than his fair diagrams = good”. The syllogism was change, and the same person who one share in the whole charade, I instead clear – if they too could create presen- day drew multidimensional Shlaer- had to redefine my definition of irony tations that others couldn’t understand Mellor data universes, overnight when he then espoused his own partic- perhaps one day they could assume the becomes an expert at the new tech- ular variant of XP, tried to sell his same authoritative role over the audi- niques and wastes valuable project dol- recently published book, and attempt- ence that the science teacher enjoyed. lars and time convincing senior man- ed to convince us that you had to Acting on this childhood experi- agement that arguments about OO employ his consulting skills to make ence, the analyst buys books about notation and design patterns are now sure the methodology was being fol- analysis patterns and sets about to con- the key to project success. A profession- lowed correctly. fuse and overwhelm all around him. al software analyst is a master of trend I often wonder whether the FBI Expensive tools are bought that don’t moulting, chasing bandwagons faster department investigating bogus claims create any code or contribute to the than a Republican party candidate. by companies selling penis-enlarge- finished software product, but never- Fortunately, it finally looked like ana- ment pills should perhaps turn their theless print out reams of paper and lysts were going to be run out of town attention to professional software ana- create meaningless diagrams. Other when grass root programmers gained lysts. Same scam, different scenario. Java Java Dudes

66 August 2003 www.JavaDevelopersJournal.com Fair Isaac and It’s just a smarter way to do business are trademarks or registered trademarks of Fair Isaac Corporation, in the United States and/or in other countries. Other product and company names herein may be trademarks or registered trademarks of their respective owners. Copyright © 2003 Fair Isaac Corporation. All rights reserved.

CAN YOUR CODE

KEEP UP WITH YOUR } BUSINESS GROUP?

Fair Isaac Blaze Advisor lets you create, deploy and modify the rules that drive your

business—quickly, easily and cost-effectively. Maintained separately from the rest of

your system code, our business rule technology gives you unprecedented visibility into

and control over logical decisions used throughout your enterprise. Save time, save money,

save yourself headaches. Visit our Web site for more information about Fair Isaac

Blaze Advisor business rules management. It’s just a smarter way to do business.TM www.fairisaac.com/rules Introducing JProbe® 5.0 …now smarter and faster than ever

JProbe® Find the cause of J2EE code performance, memory and threading problems faster than ever before with JProbe 5.0. New investigative features for finding memory problems combined with dramatic performance improvements mean even quicker resolution of problems in your application, servlet, JSP and EJB code.

JProbe Suite

JProbe Profiler

JProbe Memory Debugger

JProbe Threadalyzer

JProbe Coverage

For more info and a free eval, visit: http://java.quest.com/jprobe/jdj

© 2003 Quest Software, Inc. Quest, Sitraka, PerformaSure and JProbe are trademarks or registered trademarks of Quest Software, Inc. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All other products are trademarks or registered trademarks of their respective companies.