In the previous article, we gained an overview of what the Unified Modeling Language stands for and what are the nine diagrams that make up UML. Because UML is essentially a set of diagrams, you can simply draw them by hand on a piece of paper. But, drawing UML diagrams on a piece of paper is certainly not a best practice to design systems. Software applications simplify the task of drawing diagrams of software designs. In addition, because the design is in an electronic format, archiving the design for future use, collaborating on the design becomes much easier. Also, routine tasks can be automated by using a UML tool. Hence, using a UML tool is by far the most preferred way for designing software applications.
Features in UML Tools
This takes us to an important question—what exactly should we look for in a UML tool?
Because the primary use of a UML tool is to enable you to draw diagrams, first and foremost, we need to see what types of UML diagrams the tool supports. But, is drawing UML diagrams all that you would expect from a UML tool? For example, wouldn’t it be great if the class diagrams that you draw in the tool can somehow be used to generate the source code for actual Java classes or C++ classes?
Let us take a look at another scenario. Suppose you were given a large set of source code files with lots and lots of classes. Wouldn’t it be a nightmare wading through the code trying to figure out how all the classes are interconnected? This is where UML tools step in to make things a lot easier by providing support for such features. Now, let’s define these features in technical terms:
- UML diagram support: The UML tool should support all the nine diagrams that make up UML. You should look for a tool that supports drawing use cases, designing the static view diagrams such as class diagrams and object diagrams, defining the dynamic view diagrams such as sequence, activity, state, and collaboration diagrams and the component and deployment diagrams that form the implementation view of the system.
- Forward engineering: A UML tool should not have its use limited to just a pictorial depiction of diagrams. Because the structure of the system defined by the diagram is translated by a developer into actual source code (classes), the UML tool should bridge this step by generating the source code of the classes with the methods stubbed out. Developers can take up this stub code and fill in with the actual code. This characteristic of automating the generation of source code is called forward engineering. Forward engineering support by a UML tool is normally for a specific language or a set of languages. If you are a Java developer, verify that the UML tool that you want to use has forward engineering support for Java. Similarly, if you are a C++ developer, the UML tool should provide you forward engineering support for C++.
- Reverse engineering: Reverse engineering is exactly the opposite of forward engineering. In reverse engineering, the UML tool loads all the files of the application/system, identifies dependencies between the various classes, and essentially reconstructs the entire application structure along with all the relationships between the classes. Reverse engineering is a feature normally provided by sophisticated and high-end UML tools.
- Round-trip engineering: Another useful feature apart from forward and reverse engineering is round-trip engineering. Forward and reverse engineering are essentially one-off activities that take input and generate the required output. Round-trip engineering extends these features.
An important rule in software design is that no design remains unchanged. This is as true for small systems as it is for large systems. During development, the design structure defined in the UML model does undergo changes to incorporate physical differences in implementation that may not have been envisaged during design. It becomes very difficult to keep the design of the system updated with the changes in the source code. The round-trip engineering feature enables the UML tool to synchronize the model with the changes in the application code.
- Documentation: Documentation is an integral aspect of a UML tool. Software designing, by nature, is an abstract process. Apart from a few syntax and semantic ground rules, there are no other rules. The thought process of a software architect who designs applications using UML can be lost if the reasons behind certain design decisions are not captured and well documented. This becomes painfully clear when large systems are maintained and no one has a clue to why a subsystem was designed in a certain way. Hence, a UML tool must necessarily provide some way for the designer to document design decisions in the diagrams by using simple things such as annotations or comments. In addition to this, the UML tool should support the generation of reports/listings of the different design elements of the diagram.
Apart from the above features, you should also identify a few features that would definitely be useful to have in the UML tool.
- Version control: A very important feature that we want to have in the UML tool is either an integrated version control mechanism or connectivity to a standard version control system. Configuration management is an integral part in the building of software systems. Considering that the design of a system is a very important artefact of the software lifecycle, maintaining versions and baselines of the system design is a desirable feature to have in UML tools. In the absence of direct support for version control, it is the responsibility of the designer to maintain versions of the design.
- Collaborative modeling environment: Enterprise systems are huge and their designs are quite complex. While designing complex systems, there may be different teams involved and may carry out design work on different subsystems in parallel. This collaborative design effort needs to be properly synchronized by the UML tool. The UML tool should provide support for a collaborative modeling environment with capability to compare different versions designs for differences or even merge different versions of a design. Collaborative modeling is always a nice feature to have in UML tools.
- Integration with popular Integrated Development Environments (IDE): With the increasing use of iterative methodologies for building software systems, it becomes very difficult to keep the design of the system in sync with the developed code. Hence, it would be useful if the UML tool provides integration with popular IDEs. This feature would enable the UML tool to be updated with the changes in the source code made in the IDE.
- Test script generation: The system or subsystem designed in a UML tool may represent a set of functional aspects as well. Hence, it would be really useful if, in addition to generating stub code, the tool also generates test scripts that can be used for testing how the generated class functions.
- Model View Controller (MVC) modeling: Enterprise application architectures have increasingly begun to standardize and are based on the Model View Controller architecture. Hence, if you design n-tier, Web-enabled enterprise applications, you should look for a UML tool that supports designing applications based on the MVC architecture. Support for MVC modeling makes it easier to organize and clearly distinguish the design elements along the lines of the MVC layers. This will help in the long run in improving the readability of the model.
Re-usability is the key to improving productivity. An application design may consist of several classes with relationships defined. Quite a few times, while designing applications, you encounter the same design problems or scenarios and end up defining the same design again and again. By using a modeling tool, you can define certain components or even subsystems that might potentially be reusable in the future. For example, design elements of an application used to define access to the database using, say, a ConnectionPool class are potentially reusable. You might need to define a similar database connection pool in another application as well. Hence, it would benefit us in the long run if we design the ConnectionPool class separately. We then can include the ConnectionPool design in any future subsystems and avoid the need of reinventing the wheel.
Such reusable designs or models are termed as templates and the entire modeling process involving the identification and use of templates is called template-driven modeling. The benefits of template-driven modeling are apparent in the savings in design time. You can consider model templates to be very similar to reusable code libraries used in application development.
Popular UML Tools
We will list here a few of the “movers and shakers” of vendors of UML tools. Please note that this list is by no means exhaustive and is not meant to provide any ranking for any UML tool.
- Rational Rose: No discussion of UML tools is complete without the mention of the Rational Rose modeling tool from Rational Software Corporation. Rational Rose (the Rose stands for “Rational Object-oriented Software Engineering”) is a visual modeling tool for UML. It comes in different versions suited to different requirements. Rational Rose provides support for all the standard features that we discussed in the previous section such as UML diagram support, forward and reverse engineering support, and documentation and round-trip engineering support. Apart from this, Rational Rose also provides support for version control, IDE integration, design pattern modeling, test script generation, and collaborative modeling environment. In addition, Rational Rose also supports the designing of data models within the same environment. An interesting feature of Rational Rose is the ability to publish the UML diagrams as a set of Web pages and images. This enables you to share and distribute your application design where the Rational Rose tool is not installed.
- Together Control Center: Together Control Center (formerly from Togethersoft) from Borland is an entire suite of visual modeling tools for UML. Together Control Center supports UML diagrams, MVC modeling, forward and reverse engineering, and round-trip engineering, as well as integration with IDEs such as IBM WebSphere Studio.
It supports comprehensive documentation and a powerful collaborative modeling environment.
An added feature of Together Control Center is the pattern repository. The pattern repository (similar to the template-driven modeling concept discussed above) makes frequently used diagrams and design patterns readily available for reuse in modeling. Together Control Center supports the Rational Unified Process as well as the eXtreme Programming methodologies.
- Poseidon: Poseidon from Gentleware has its roots in the ArgoUML open source project. The ArgoUML modeling tool evolved as an open source effort and is a useful, full-featured UML tool freely available under the Open Publication License. Gentleware has taken ArgoUML a step further and turned it into a good modeling tool. Poseidon comes in different flavors suited to different requirements. Poseidon supports forward and reverse engineering and documentation generation by using special-purpose plug-ins.
Gentleware has not forgotten its open source moorings and offers the Poseidon for UML Community Edition 1.5 free for individual software developers.
Integration of UML Tools with Integrated Development Environments (IDEs)
One interesting feature in UML tools that we discussed in the previous section was round-trip engineering. For round-trip engineering to be useful, we need to have the UML tool to be used in conjunction with an IDE. This integration of a UML tool with the IDE will help you to really benefit from round-trip engineering. Any changes in the application code that you make in the IDE are immediately reflected in the model in the UML tool and vice versa. For our discussion, we will be considering IDEs for the Java language.
Quite a few of the UML tools on the market can be integrated with the popular IDEs such as IBM’s WebSphere Studio, Borland’s JBuilder, WebGain’s Visual Café, or Sun’s Forte. For instance, Rational Rose (Java edition) provides integration with all of these popular IDEs. Together Control Center has a special version that integrates with IBM’s WebSphere Studio.
The downside of UML tool integration is that the integration solution is proprietary to the UML tool vendor. Hence, you might not always find a UML tool providing integration with popular IDEs in the market. But all this is changing. (See box for details on the Eclipse project.)
|Eclipse is an open source effort that has tool integration as the long-term goal. The interesting aspect of Eclipse is that the effort is supported by major tool vendors. Eclipse aims to define across-the-board integration standards that will enable vendors of different tools to seamlessly work together and provide a cohesive and single development environment. The beauty of Eclipse is that the integration between tools is not a proprietary solution. In layman’s terms this means that, for example, you can buy an off-the-shelf UML tool and integrate it into your development environment without having to worry that you might be stuck with a particular vendor or group of vendors. Eclipse is definitely an area to watch out for in the near future! (www.eclipse.org)|
We will apply the UML concepts that we will be discussing through the coming weeks and design an entire real world application. Each session in the coming weeks will be rounded off with designing the case study application incrementally using each of the UML diagrams.
For our case study, we will be the architects assigned the task of constructing the design elements for a system that can be used to manage coursees/classes for an organization that specializes in providing training. Let us name the system that we will be designing as the Courseware Management System. The organization offers a variety of courses in a variety of areas such as learning management techniques and understanding different software languages and technologies. Each course is made up of a set of topics. Tutors in the organization are assigned courses to teach according to the area that they specialize in and their availability. The organization publishes and maintains a calendar of the different courses and the assigned tutors every year. There is a group of course administrators in the organization who manage the courses including course content, assign courses to tutors, and define the course schedule. The training organization aims to use the Courseware Management System to get a better control and visibility to the management of courses as also to streamline the process of generating and managing the schedule of the different courses.
Now that we have our problem statement defined, we can proceed to the next step—analyzing and elaborating on the requirements and then designing the Courseware Management System in the coming weeks.
UML tools will form the basis of our activities in the coming weeks. Each of the UML diagrams that we will cover will be built using any of the available UML tools in the market. Today’s discussion helped us understand what features we should look for when selecting a UML tool. Apart from the “must-have” features, we also checked out a “wish list” of features that a UML tool could have. The classroom courseware case study application that we discussed will be designed using when we cover each of the UML diagrams in the coming weeks.