HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML

Test Environment
Client: Dell Precision 410, 128MB RAM, 18GB disk drive,
Windows NT Workstation 4.0 SP 5

Codagen Technologies Corporation
2075 University St., Suite 1020
Montreal, Quebec, Canada, H3A 2L1
Phone: 514 288-4802
Fax: 514 288-2446

Gen-it for Java $4,900/ Developer
Batch-it for Java $295/ Developer

In last month's issue of JDJ (Vol. 5 issue 6) I talked about the concept of using frameworks to automate the development of J2EE applications. Armed with this concept I took a look at Codagen Technologies' Gen-it for Java 1.1.

Codagen's product is designed around the basic premise that much of the lower-level structural code within an application is highly repetitive. Routine tasks such as persisting objects into the database, managing locks and performing integrity checks can be easily generated from a template rather than built from scratch each time.

Codagen's product is slightly different from a typical application generator in that it works in conjunction with frameworks that you may already have built. (In fact, Codagen has a partnership with IBM to leverage their San Francisco object framework with Gen-it for Java.) In the following sections I'll take a look at installing and using Gen-it for Java using one of their sample projects.

Installing and Configuring Gen-it for Java
I downloaded the 1.1 release of Gen-it for Java from Codagen's Web site. (Since this article was written, version 1.2 has been released.) The InstallShield setup kit is a little under 9MB in size and installs quickly and easily. Codagen uses Globetrotter's FlexLM software to control licensing for Gen-it for Java, but the downloaded installation kit is preconfigured with a demo license key already installed. When all is said and done, the installation process was a quick and painless affair - I had Gen-it up and running in about 15 minutes. One factor worth mentioning is that Gen-it for Java requires either Rational Rose or Visual Modeler (a version integrating with Telelogic's Tau, formerly Sterling's Cool:Jex, is scheduled for beta this month) to be installed on your local machine before the Gen-it installation can proceed. If you want to test Gen-it for yourself, you'll need to acquire one of the modeling tools in advance. (Rational allows you to download Rational Rose Enterprise Edition 2000 for a 20-day trial period as well.) Once the product is installed, it's a simple process to start working with Gen-it.

Working with Gen-it for Java
Codagen provides a tutorial that describes the basic value proposition for Gen-it for Java, and I would recommend going through it as a starting point. The Codagen folks believe strongly that frameworks are just as important for small and medium projects as they are for large projects - and the introduction section of the tutorial is dedicated to explaining this concept. As IT professionals and application developers we're certainly living in a time of tight deadlines and complex projects. I'd argue that very few projects in today's world are actually "small" projects. Sure, they might start out small; but they often end up being much larger efforts over the life of the application. Does this mean that we're underestimating the initial development effort in the first place? Not necessarily. We've all learned the lesson that large, multiyear projects are less likely to be successful than smaller, tactical projects. (We may be short on empirical evidence for this hypothesis, but it appears to be so from anecdotal evidence.) The result of this collective experience has been a trend toward projects that are much shorter in duration. This doesn't mean that we simply ignore larger, more complex, long-term projects. Rather, we have a better chance of success in managing large projects if we can break them down into a series of smaller projects with highly focused goals. Even projects that appear to be smaller in scope can grow as the needs of the business change. For many companies the first step into the Internet is a simple Web site soon to be followed by a dynamically generated Web site, online payment, interfaces to partners - the list is endless. Of course, one result of taking a large, complex project and breaking it down into smaller, more manageable chunks is that without a proper game plan it can lead to chaos. This is exactly where the folks at Codagen have designed the Gen-it product to play. Tackling larger projects (or small projects that grow into large projects over the life of the application) becomes possible when you use a well-planned architecture.

Gen-it is designed with the idea of removing the burden of implementing repetitive code from the hands of the programmer. It differs somewhat from typical frameworks in that it has been designed to work in conjunction with a framework. Thus, while most framework products are harnessed into the programmer's interactive development environment (IDE), Gen-it is plugged into the modeling environment. Figure 1 shows this relationship graphically.

Figure 1
Figure 1:

The implied development methodology that Gen-it follows starts with a UML model. Having defined the model, you then choose a prefabricated framework for deployment (such as EJB or San Francisco). Once you have the framework, you then use the Gen-it tools to create a set of templates that would be used to harness the framework to your UML model. A thorough understanding of UML isn't required as Gen-it currently uses only the UML class diagram. Furthermore, Gen-it doesn't affect the visual representation of a UML model. It simply uses the items found in the static view - the class diagram - as convenient holders for extra structural information.

Codagen recommends you make use of their consulting resources in order to evaluate the Gen-it for Java product, and based on my experiences with it I would have to agree. While the tutorial attempts to walk you through the development process using the simple "Memento" framework model, inexperienced developers aren't likely to pick up on the benefits through the tutorial. Version 1.2 has reworked the tutorial to address these shortcomings.

The main interface for Gen-it is the organizer (see Figure 2), used by application architects in creating and managing templates. Templates define the specific actions implemented for the various classes in your application. In essence, the templates map the framework to your UML model.

Figure 2
Figure 2:

Individual developers can be given access to the templates for use in generating code using the Batch-it interface. While Gen-it allows the application architect to modify templates, Batch-it developers are restricted to code generation based on the templates. In this way you can prevent individual developers from straying away from the framework by consolidating template management to a smaller subset of critical developers. Gen-it's real power is based on this template feature - but it's difficult to get the true flavor of templates from the downloadable kit. Even if you were able to work with templates extensively in the downloadable version, I would still recommend that you take advantage of Codagen's consulting services in evaluating Gen-it for Java. The real value in this product is in the creation and deployment of a framework throughout your application. By working closely with the Codagen experts, you're much more likely to get the most out of the templates interface. (The tutorial and user guides aren't enough to get you rolling with Gen-it on a real project.) If you're familiar with Rational Rose, at least, then part of the overall learning curve will be much easier. Gen-it for Java is linked directly into the Rational Rose IDE (see Figure 3).

Figure 3
Figure 3:

The evaluation kit includes several Rational Rose models, including the Banking Model shown in Figure 3. Using the Gen-it tools within Rational Rose allows you to record design decisions directly in your UML model. Gen-it properties are attached to the UML model by means of External Properties, which are specific to a class, attribute or role. Gen-it uses the external properties that you set in the model to apply template definitions to your generated code. Once you select a set of classes (or packages) in your model and choose the "Gen-it" option from the menu, the Organizer interface will appear as shown in Figure 2. (Codagen provides an option that will allow Gen-it to write the generated code directly into IBM's Visual Age for Java as well.) The result is a fairly seamless transition from UML to code - provided that you have the proper templates.

The twin problems of limited resources and short deadlines can be mitigated by leveraging application frameworks. Codagen's Gen-it for Java product is a useful tool for connecting frameworks to models. Though Gen-it does require more than a casual understanding of Java and architecture, Codagen encourages you to use their technical support for evaluation and product issues. It's free and it helps them better understand customer issues. The consulting services can be used for more in-depth issues related to deeper architecture issues. Products such as Gen-it that have the potential to significantly shorten your development cycles are not simply "plugged-in and turned on." However, if you're short on Java programmers and want to make your development resources go farther, then a little up-front effort can pay big dividends down the road.

Author Bio
Jim Milbery is a software consultant with Kuromaku Partners LLC ( www.kuromaku.com), based in Easton, Pennsylvania. He has over 15 years of experience in application development and relational databases. [email protected]


All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.