Visual editing 3GL code in UML notation diagrams

Using models, you can visualize and edit third-generation languages (3GL) such as Java™, C++, C#, and declarative languages such as Web Services Description Language (WSDL), and XML Schema Definition Language (XSD). Visual editing involves using diagrams that have a common notation that is consistent with the Unified Modeling Language (UML). In a modeling diagram, you can see a visual representation of the application code and make changes to the diagram, which are automatically reflected in the application code.


This product supports development workflows for 3GL applications by using an integrated development framework, transformations that generate code from the UML model, and code editors that provide a UML representation of the code. Development tools provide an integrated development framework in which you can develop new or existing applications. A UML-to-3GL transformation seeds code from a UML model. For more complete control over the generated code, you can apply a profile to add language-specific annotations to UML models. The UML code editors are graphical editors that use UML notation to help you visualize, understand, design, and implement the structure and interactions of your implementation.

This modeling approach uses an agile-type code-development process, where the focus is on coding without much formal analysis and design. You can use IBM® Rational® Software Architect to create a code model for 3GL languages, such as Java and C++, by editing the code in diagrams that use a UML-like notation. You can visually edit diagrams to add new code elements, such as classes, fields, and methods, or you can drag existing code elements into diagrams. You can also use tools such as topic diagrams, browse diagrams, and static method sequence diagrams to help visualize and understand the relationships and timing of the system. The diagrams automatically reflect all semantic changes to the code, and are a visual medium for making changes.

You can visually edit application code in any software development environment. Adopt this approach if your project philosophy favors agile development. This modeling approach is also good for small or inherently low-risk projects that and do not require rigorous analysis or design. 3GL visual editing is a low-overhead approach and provides uniform documentation that you can use to effectively communicate with stakeholders.


In a diagram that visually represents code, you can see an application and its interactions and how the different classes relate to each other in the overall picture. With this view, you can create better code and understand the application thoroughly. Documenting your implementation in UML notational diagrams is an effective way to describe a system to less-technical project stakeholders and can help fulfill compliance requirements in a regulatory environment. This approach also provides a powerful and quick way to understand how an unfamiliar implementation is structured and requires little experience with UML. The approach is easy to adopt because developers need to learn only a small amount of the UML notation and representing the code visually introduces few additional artifacts to manage.


Although visually editing does promote a better understanding and views of the whole picture, this approach is limited and might not provide the function that you need to edit complex or nonuniform code. Visually editing does not support high governance, which makes it easy to use but lacks tight control from an architect who can reduce project risk and control over the evolution of the implementation. Visually editing also does not give you the opportunity to use the advanced modeling features that increase quality and productivity, such as patterns and transformations.

AS the following figure illustrates, you can visualize your Java classes in a diagram file, that has a .dnx as a file name extension. Any changes that you make to the code or the DNX file is updated in both views.

Java file containing code that will be visualized.

Visualization of Java classes.

If you Select the option to visualize a diagram file, a class diagram is created with the selected Java classes visualized.

You can make changes inside the diagram file or to the individual Java classes and both reflect the changes.