RAD Studio (Common)
The Code Visualization feature is available in both the Enterprise and Architect versions of RAD Studio. All other modeling tools and information related to modeling relates only to the Architect version of RAD Studio.
RAD Studio has a code visualization diagram that presents a graphical view of your source code, which is reflected directly from the code itself. When you make changes in source code, the graphical depiction on the diagram is updated automatically. The code visualization diagram corresponds to a UML static structure diagram. A structural view of your project focuses on UML packages, data types such as classes and interfaces, and their attributes, properties, and operations. A static structure diagram also shows the relationships that exist between these entities.
This section will explain the relationship between source code and the code visualization diagram.
RAD Studio's code visualization tools use the UML notation and conventions to graphically depict the elements declared in source code. The Code Visualization diagram shows you the logical relationships, or static structure in UML terms, of the classes, interfaces and other types defined in your project. The IDE creates the Code Visualization diagram by mapping certain source code constructs (such as class declarations, and implementation of interfaces) onto their UML counterparts, which are then displayed on the diagram.
To begin, code visualization consists of two parts of the IDE working together: The Model View window, and the Diagram View. The Model View window shows you the logical structure of your projects in a tree, as opposed to the file-centric view of the Project Manager window. Each project in a project group is a top-level node in the Model View tree.
Nested within each project tree-node, you will find UML packages. Each UML package corresponds to a Delphi unit declaration in your source code. You can expand the UML package to reveal the types declared within.
The UML term for the relationship formed when one class inherits from a superclass is generalization. When the IDE sees an inheritance relationship in your source code, it creates a generalization link within the child class node in the Model View tree. On the Diagram View, the generalization link will be shown the using standard UML notation of a solid line with a hollow arrowhead pointing at the superclass.
The UML term for interface implementation is realization. Similar to the case of inheritance, the IDE creates a realization link when it sees a class declaration that implements an interface. The realization link appears within the implementor class in the Model View tree, and on the diagram as a dotted line with a hollow arrowhead pointing at the interface. There will be one such realization link for every interface implemented by the class.
In the UML, an association is a navigational link produced when one class holds a reference to another class (for example, as an attribute or property). Code visualization creates association links when one class contains an attribute or property that is a non-primitive data type. On the diagram the association link exists between the class containing the non-primitive member, and the data type of that member.
Code visualization can also map class and interface member declarations to their UML equivalents. Within the elements on the Code Visualization diagram, members are grouped into four distinct categories:
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!