Table of Contents

One of the most anticipated features for the latest release of Delphi is support for the Delphi language with Borland's Together technology. Together includes UML modeling, source code development, maintenance, and management features for both Delphi and the C# language inside Borland Developer Studio.

Overview

Together has features that break down into five major functional areas in this release of Delphi.

New LiveSource Class diagramming, with two-way modeling – changes in code reflected in the model and vice versa

In this article, I'll briefly introduce LiveSource, Audits and Metrics, and Document Generation. If you would like to watch what you can do with Together in Delphi, watch the BDNtv episode Overview of Together in Delphi 2006.

LiveSource modeling

You can start with any existing Delphi or C# project to quickly see what LiveSource can do for you. When you open your project, it will not have modeling support enabled by default. If you click the model view tab, which is the tab after the project manager, as shown below.

After you answer "Yes", you can see the model-oriented view of any project in your project group that has modeling support enabled. I have navigated down into this Delphi Win32 project so you can see how the model view is organized by namespaces (and other models you might have in the project).

Model navigation to code

The very small image in the bottom right is the Overview of the entire model. This Together feature allows you to quickly select your specific view, based on your current display size, out of everything on your diagram. This is a very convenient navigation feature when your models are large or your display resolution is small.

From any item in the diagram, you can bring up the context menu synchronize the model view tree node with the active item, go to the definition of the item in the source code, create reusable patterns (from multiply selected items), perform refactorings, and so on.

Audits and Metrics

Together has very sophisticated source code analysis capabilities that do not require running the application to perform the analysis. This static code analysis is based on detailed examination of all the source files you tell Together to analyze.

Each of these categories has specific audits underneath it. You can toggle the use of an entire category, or specific audits within a category. If some of the audits in a given category are off, the category will be displayed in gray, as Coding Style is in the screen shot below. Once you have selected the audits you want to use, you can save that as a profile to use at any time in the future.

After the audit run is completed, the results are shown in the message pane inside the IDE. Each audit condition, the title of it, its severity, the "Resource" or compiler symbol referenced, the source file, and code line are all listed in the results pane. You can jump directly to any auditing issue by double clicking on the audit.

Looking at the results above, I noticed an audit I'd like to turn off – the "Use Camel casing" audit. So, I'll click the "restart" button (the bottom button on the left side of the Audits pane) and turn off the "Naming Conventions" audit, as shown below.

You can also save the results of your audits to an XML or HTML report by using the top left button on the Audits pane, or view the description for any audit by right mouse clicking on the audit and selecting Show Description. By using the buttons and context menu on the Audits pane, you can iteratively improve your code and re-run the audits without having to move all around the IDE.

If you see anything in red, that means you might have issues with your code. To find out more about the metric outside the normal bounds, you can right mouse click to view the description.

Metric description

The metric in the screen shot above, is abbreviated as RFC, which is short for Response For Class. The description of this metric is shown in the screen shot below, which was displayed in the IDE after right mouse clicking and selecting the "Open" menu item shown above.

Kiviat Chart

The Kiviat chart shown in this figure shows the vectors used for the analysis, and data points outside of the red circle correspond to the values listed in red in the table at the bottom of the screen shot.

Document Generation

Together also provides document generation for both Delphi and C# projects. Any Delphi or C# project can be documented with Together.

Here is part of a model that will be used to generate documentation for the Borland Data Provider interfaces. The documentation wizard is available from a right mouse click on the relevant node in the Model View.

The level of granularity for the documentation can be selected for every document generation. The documentation can include a navigation tree and UML diagrams. The browser can be automatically launched after documentation is generated.

Document generation is not a two-way process. All existing documentation in the target directory gets overwritten. The focus on documentation should be in putting the information directly into the source code or model for the document that will be generated. Source code comments can be extracted and put directly into the documentation in the appropriate place.

Finally, when the document generation is complete, the browser can be automatically invoked so you can view the results of the documentation, and navigate through the diagram, the navigation tree, and hyper links automatically embedded into the document for you, as shown in the screen shot above.

Conclusion

There is much more that Borland's Together technology provides to software engineering practices, and the links provided in this article are an excellent place to start learning more. The Together interface in Borland Developer Studio 2006 is a great performance (and feature) improvement over what was offered in Delphi 2005. Even if you looked at Together in Delphi 2005, you should look again. It is much more powerful and responsive than it has been in any previous C#Builder or Delphi IDE.