| By Neal Ford | Article Rating: |
|
| January 1, 2001 12:00 AM EST | Reads: |
12,044 |
One of the most important but least used techniques in software development is proper design before implementation. Everyone knows this, but it seems that no one does it. Insane development schedules, pointy-haired manager types who believe that the only "real" artifact produced by a developer is source code, and a host of other events conspire to keep development as a nonengineering pursuit. However, those who have used good design (in the form of use cases, sequence diagrams, class diagrams, and so on) find that it reduces the number of required changes late in the project, calls for fewer design changes after coding has started, and shortens development schedules.
The tool that's generally considered the Rolls Royce of CASE (Computer Assisted Software Engineering) is Rational Rose. It's the market leader and has a well-established reputation for supporting large-scale development projects. In fact, the "three amigos" who created the UML (Unified Modeling Language), Booch, Rumbaugh, and Jacobson, all work for Rational. Rose supports not only diagrams and other design artifacts, it also includes code generators to realize its diagrams in source code. It comes with built-in support for C++, Java, Visual Basic, SQL, and a few other languages. Alas, the Java code generation within Rose is a bit weak. It will generate classes based on diagrams, but its capabilities are very rudimentary. Of course, it would be nice if Rational directly supported JBuilder. This is the gap that Ensemble's Rose JBuilder Link seeks to fill.
Before talking about the product, however, a bit of background on RoseLink extensions is in order. Rose has extensive support for third-party add-ins. This may include code generators, version control packages, or anything else that developers might want to access from within Rose. In fact, an entire category of add-ins called Links exists just for code generation from models.
Basically three types of links can be created:
- forward engineering: Takes model diagrams and produces source code. However, once the code has been produced, the link has nothing more to do with it.
- reverse engineering: Takes source code and produces models from it, showing all the relationships from the code in the diagrams. However, it can't take the resulting models and generate source code.
- round-trip: Performs both of the above tasks - it can generate code from the model and vice-versa. The best round- trip links will make sure the code is synchronized, so the user canmake changes in both the model and the code, then synchronize the changes. Obviously, the last type of link is the most powerful and therefore the most desirable (and not surprisingly, the most difficult to write).
The next time you run Rose, you'll see a menu item under Tools for Ensemble Tools. The first time you run it, it will ask for a license. It looks like they've started using the same type of licensing arrangement that Rose uses, either a single license or a floating license. I'm less than enthusiastic about the way the licensing works in Rose (and consequently in Rose JBuilder Link), but I suppose it's a necessary evil. One of the options presented in the licensing manager is for a trial license, which lasts 30 days. This allows you to download a copy from their web site and put it through its paces for a month. There's one quirk that's a side effect of the licensing. When it generates a license, it looks at the network characteristics of your machine.
I installed it while I was connected to the Internet via a dial-up connection and everything worked great. However, I tried to run it later when I wasn't dialed into the Internet and it refused to run because the license couldn't identify my machine. As soon as I logged back onto the Internet, the 30-day license reappeared. What's worse, when I went back into the office and could connect through the Internet using the office LAN, it still couldn't see the license. The only way I could use the license was if I were connected to the Internet in exactly the way I was when the license was generated.
Sigh. Maybe someday tools that are paranoid about licensing will get it absolutely right. For now, it generates minor inconveniences. I can't begrudge software vendors worrying about licensing and pirated software, but it's less than optimal if it gets in the way of legitimate use. The moral: before you run Rose JBuilder Link the first time and generate the license, make sure you're connected to the outside world in the way you'll be when you're working. I don't know if this same problem manifests itself with a "real" license. If it does, it's a serious shortcoming because it wouldn't allow me to use Rose JBuilder Link when I'm away from the office. After talking to Ensemble tech support, they assured me that this is a known, intermittent problem solely with laptops, and it only affects the trial version. They also stated that they are working on a solution.
I ran Rose JBuilder Link on a 650MHz Pentium III laptop with Windows 2000 and 256MB of memory. However, it takes up fewer resources than Rose itself, and most of its work is done with file generation; thus the I/O subsystem on your machine makes more difference than the processor. The bottom line: if your machine will run Rose, it should run Rose JBuilder Link with no problem. And if your machine runs JBuilder, you have more than enough machine to run just about anything else!
As far as the tool itself, it does an impressive job. As a stress test, I took a fairly complex JBuilder project and used Rose JBuilder Link to reverse engineer it to get class diagrams. The UI link has an intuitive user interface, showing the Rose model in an outline on the left and the JBuilder project on the right as seen in Figure 1.
Rose JBuilder Link reverse engineered the project flawlessly. When it was done, I had an object model based on the project. And it doesn't just pull the objects into Rose and create Rose references to them. It also establishes the relationships between the classes - those within the project and those that are part of the Java libraries. For example, Figure 2 shows a couple of the resulting classes that it created.
As you can see, both the CustomerFrame and PartsFrame classes use the DbPanel JavaBean for user interface chores. The class diagram correctly links these classes together with a dependency arrow. Also, the InvalidBalanceException class subclasses the built-in Java Exception class, which is shown by the generalization arrow. You'll notice that all the other classes also use the Exception class because it's thrown by JBuilder's jbInit() method. This diagram would have taken a long time to create by hand, given the complexity of the application.
Rose JBuilder Link will also take class diagrams and generate source code from them. I tested this with a fairly complex set of class diagrams that my company had created for a client. Rose JBuilder Link did a good job of generating the classes and creating stub implementations for them. It will also correct syntactic errors in the model that don't conform to Java rules.
For example, a class description in the model incorrectly (from a Java standpoint) declared an array. Rose JBuilder Link corrected the problem as it generated the code. This goes above and beyond the call of duty! When Rose JBuilder Link generates code, it doesn't place "magic markers" in it. A lot of code generators do place markers in the code that can't be removed by the developer without "breaking" the reverse engineering of the code. Rose JBuilder Link handles this by placing model documentation as code comments rather than brittle "magic markers."
Once you have both a model and a project side by side, you can refresh the views and Rose JBuilder Link will highlight the differences between the model and the code. This is nice in situations where the model and the code have changed simultaneously. Within its user interface, you can see exactly what's changed in each. Once you've decided which "side" (the model or the project) needs to be updated, use the button on the bottom to handle the update for you. All in all, the user interface is intuitive and useful.
Rose JBuilder Link also includes some other tools to make JBuilder and Java development easier. One of the hassles of doing Java object modeling in Rose is the clunky user interface you must use to see attributes of classes, such as scoping and modifiers. Because Rose must support many languages, the language-specific elements are confined to a single customizable dialog box. One of the nice little tools that Rose JBuilder Link includes is an editor that allows you to set these characteristics without going through Rose's constrained dialog. This Class Editor tool is shown in Figure 3.
Rose JBuilder Link includes several other tools that space won't allow me to write about, including tools to help support server-side development such as Enterprise JavaBeans. In general, I think this is an excellent product, and it shows just how far code generation and reverse engineering have come. If you need to use Rose for object modeling (you really should be using something!), Rose JBuilder Link is a welcome time- and sanity-saving addition.
Published January 1, 2001 Reads 12,044
Copyright © 2001 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Neal Ford
Neal is the Vice-President of Technology at
the DSW Group. He is also the designer and
developer of applications, instructional
materials, magazine articles, video presentations,
and author of the books Developing with Delphi:
Object-Oriented Techniques and JBuilder 3
Unleashed. Neal has also been the featured
speaker for the Borland Delphi/C++Builder/JBuilder
World Tours and has spoken extensively at annual
Borland Developers Conferences worldwide.
He can be reached at nford@thedswgroup.com
or by calling The DSW Group at 800-356-9644.
- Patterns for Building High Performance Applications
- It's the Java vs. C++ Shootout Revisited!
- Asynchronous Logging Using Spring
- Java for Programmers (2nd Edition)
- Cross-Platform Mobile Website Development – a Tool Comparison
- Three Buzzwords That Every CIO Hears but One They Should Listen To
- Write Once Run Anywhere or Cross Platform Mobile Development Tools
- Immersing into JavaScript Frameworks
- Workday Reportedly Prepping to Go Public
- Cloud Expo New York: The Java EE 7 Platform - Developing for the Cloud
- Book Review: Sams Teach Yourself Java in 24 Hours
- OpenOffice.com Lives
- Book Excerpt: Introducing HTML5
- Adobe Sends Flex to the Apache Foundation
- Five Years Waiting for JRE 7: Is It Justified? (Part 1)
- Book Excerpt: Java Application Profiling Tips and Tricks
- i-Technology in 2012: Five Industry Predictions
- Patterns for Building High Performance Applications
- It's the Java vs. C++ Shootout Revisited!
- OpenXava 4.3: Rapid Java Web Development
- The Next Web Architecture
- Asynchronous Logging Using Spring
- Java for Programmers (2nd Edition)
- Is Write Once Run Anywhere Ever Going to Be a Reality?
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- JavaServer Faces (JSF) vs Struts
- The i-Technology Right Stuff
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- What's New in Eclipse?
- i-Technology Predictions for 2007: Where's It All Headed?



















