By: Michael Rozlog
Abstract: Understanding the UML features in RAD Studio 2010, Delphi 2010, and C++Builder 2010
By: Michael Rozlog
Sr. Director of Delphi Solutions
Date: Friday, September 11, 2009
As most developers know, RAD Studio, comes with both C++Builder and Delphi. The UML and static analysis features have been added to all levels of the product, so if you are using Delphi 2010 or C++Builder 2010 Professional, Enterprise, or Architect you will have access to some if not all the UML features in the product. For Delphi 2010 users, audits and metrics have been added to each level of the product, so even users of our Professional level products get some of the advanced features.
Below is a simplified list of features included in RAD Studio 2010:
UML Code Visualization—at any time, get a UML model view of your source code
Diagrams have an updated look and feel
Use case diagrams
80+ Code Metrics that allow for deep understanding and static analysis of the health of the object domain
Introduced for Delphi Professional in 2010! 10+ introductory level code Metrics for understanding the health of the object diagram
200+ Code Audits for deep code analysis to better understand the coding style and approach
Introduced for Delphi Professional in 2010! 10 introductory level code audits for better code understanding
Import model from Rational® Rose (mdl import)
Language neutral UML 1.5 and 2.0 modeling
Transformation from language neutral UML 1.5 and UML 2.0 projects to source code projects
Design Patterns support, including GOF patterns
Custom design patterns support
XMI 1.1 Import/Export
OCL 2.0 support
"UML in Color" profile
Diagram hyper-linking and annotations
The short answer to that question is NO. It is still based on the same technology, but many, many, upgrades have occurred to make the product faster to load, faster to reverse and forward engineer, and presents a much more modern look. The same benefits of these tools still hold true today, that they help developers get more done in a shorter amount of time.
Today Delphi and C++Builder users can reverse engineer a class diagram at any time in all levels of the product.
In the enterprise and above, developers can make changes to the code or model and both will be kept in synch with each other. So if the developer would right-mouse click on the above diagram and adds a Class, the code would also be generated in the unit for that class. This 2-way capability, a feature called LiveSource™, makes adding anything to the class diagram, and ultimately your code, as simple as a right-mouse click to the context menu shown below.
As you can see from the above, the UML integration allows for support around Pattern, so if you want to create a GOF Singleton pattern, click the Create by Pattern… menu item and select it from the included patterns in the product:
Click the Ok button and the pattern will be added to the model and corresponding code will be generated.
In the Enterprise edition and above, developers have full UML integration meaning they can create any of the standard UML diagrams.
For those not familiar with what each diagram is really responsible for, the following is a list:
Today, when it comes to support for UML, RAD Studio is making key technologies available to developers to help them communicate better, create better designs quicker, have the ability to set coding standards, and check the health of a Delphi application. Plus, it also supports automatic Documentation Generation, which all developers like.
RAD Studio 2010 Architect adds support for both types of diagrams; ones based on source code and the other based on design. An example of a diagram based on source would be a Class diagram, which uses the LiveSource™ engine to automatically keep the code and model in-synch at all times. Whereas, a language neutral design is only based on the UML specification and no code is generated or needed. The tool also includes the ability to take these language neutral designs and generate source code for the designs, which gives the best of both worlds; the ability to create great object models, and if code is needed it can work with that just as easily.
This is a great time saver and adds significant piece of mind knowing that when a change is made in either the code or the model, that both areas will be up-to-date. A design diagram (with no source code dependencies) would be a Use Case; this communicates high-level functional requirements graphically.
RAD Studio 2010 makes it extremely easy to use UML and takes advantage of the advanced tools. First, either start with a new project like you would normally do, or open up an existing project. Once the project is open click on the Model-View tab under the project manager or Project|Model Support… menu item.
Hide image Hide image
Clicking either of these on the open project will activate the UML integration and present a new dialog:
Simply click the Yes button and you’re on your way. This will then open the design surface and will use the LiveSource™ technology to reverse the project and give you a Class diagram as shown above. Again, any changes made in the model will be reflected in the code, so if you change the model, like a string attribute to a new name, that name will now be in the code as well.
From this point you can add more objects, setup associations, aggregations, and all things object oriented. You can also add new models to the project and these industry standard diagrams, including use case diagrams, class diagrams, and sequence diagrams, etc., to help developers using UML to communicate.
The Delphi 2010 part of RAD Studio also brings more than simple modeling to the tool. You can use Delphi 2010 to analyze your existing projects, and generate metrics and audits that you can use to uncover potential problems with your applications. For example, the following figure shows a generated Kiviat chart. A Kiviat chart depicts a best practices circle. Points that are within the inner circle are considered acceptable, and those outside denote areas that may deserve your attention.
For example in the graph shown here, the depth of inheritance hierarchy (DOIH) appears outside the user defined inner circle. This metric indicates that one or more of your classes are abnormally deep, with respect to the root class (Object or TObject).
You set the limits for the metrics used by Metrics. The following figure shows the QA Metric dialog box where these metrics are configured.
Delphi 2010 covers the major areas of Metrics, with over 10+ included in professional and 80+ in the Enterprise and above. Below is a high-level table of which ones are included:
The use and configuration of audits is similar to metrics. The following figure shows the QA Audits dialog box, which contains the audits equivalent to the QA Metrics dialog box.
Delphi 2010 covers the major areas of Audits, with over 10+ included in professional and 200+ in the Enterprise and above. Below is a high-level table of which ones are included:
Arrays and References
Branches and Loops
The static analysis using code Audits will look at every single line of every single method of every single class, or every single namespace, and generate a list of faults that you define. This helps with poor code and refactoring.
One of the other major features found inside the UML integration is automatic Documentation Generation. Notice in the below figure that complete developer documentation has been produced by a simple click of a menu item.
These advanced tools really help all of the developers out there, from the Architects to the newbie just starting with RAD Studio 2010. The advanced tools like LiveSource™ to keep the code and model in-synch, and the ability to generate new models for better communications, is great. It is also nice that advanced tools like static Code Audits and Metrics are available, especially if large amounts of code is being inherited or a team wants to know where the code really is as far as health and standards. Finally, the ability to generate the documentation with hyperlinks, which links the various models together, is a real time saver and allows developers to keep up-to-date with a click of the button.
Server Response from: ETNASC03