C++ Round-Trip Engineering in Visual Paradigm Desktop

Visual Paradigm Desktop supports C++ Round-Trip Engineering, allowing developers and software architects to generate C++ source code from UML class models and reverse engineer existing C++ source code back into UML class models. By supporting synchronization in both directions, C++ Round-Trip Engineering helps keep software design models and implementation code aligned as a project evolves.

Whether you are designing a new C++ application, updating an existing implementation, documenting a legacy codebase, or maintaining consistency between software architecture and source code, Visual Paradigm provides an integrated environment for working with UML class diagrams and C++ source files.

What Is C++ Round-Trip Engineering?

C++ Round-Trip Engineering is a code engineering capability in Visual Paradigm Desktop that enables two-way synchronization between UML class models and C++ source code. It combines forward engineering (generating or updating C++ code from UML) with reverse engineering (generating or updating UML classes from C++ source code).

Unlike one-time code generation or reverse engineering, round-trip engineering supports an iterative development workflow. Developers can begin with a UML class model, generate C++ source files, modify the implementation, and then bring relevant changes back into the UML model. They can subsequently update the source code again when the design changes.

The two primary operations are:

  • Generate/Update C++ Code: Convert UML class models into C++ source files or update previously generated source code to reflect changes in the model.
  • Generate/Update UML Classes from C++ Code: Analyze C++ source files to create UML class models or update existing UML classes to reflect changes in the implementation.

These capabilities establish a repeatable workflow between software design and implementation, helping teams maintain more accurate and useful technical documentation.

Why Is C++ Round-Trip Engineering Essential?

C++ Round-Trip Engineering helps address a common software development challenge: the gradual divergence between the original software design and the actual implementation.

When developers modify source code independently of the design documentation, UML diagrams can quickly become outdated. Conversely, when design changes are made without updating the implementation, the source code may no longer reflect the intended architecture.

Visual Paradigm helps reduce this gap by allowing developers to synchronize the two representations as part of their development workflow.

Keep UML Models and Source Code Aligned

Generate C++ source code from UML class diagrams and update UML classes from changes made in the source code. This makes it easier to maintain consistency between the design and implementation.

Accelerate Initial Development

Instead of manually writing every class declaration from scratch, developers can define classes, attributes, operations, and relationships in UML and generate corresponding C++ source code.

Document Existing C++ Applications

Reverse engineer existing C++ source code into UML class models to understand the structure of an application. This is particularly useful when working with legacy systems, inherited projects, or applications with incomplete documentation.

Support Iterative Software Development

Software design and implementation frequently evolve together. Developers can update the UML model after changing the source code and regenerate code after modifying the design, supporting an iterative development process.

Improve Communication Between Developers and Architects

UML class diagrams provide a visual representation of software structure. By deriving models from actual source code, teams can use more accurate diagrams when discussing class responsibilities, attributes, operations, and relationships.

Reduce Repetitive Documentation Work

When implementation changes, developers can update the UML model through reverse engineering rather than manually recreating the affected class definitions.

Edition and Availability

C++ Round-Trip Engineering is available in the following Visual Paradigm Desktop editions:

  • Enterprise Edition
  • Professional Edition
  • Standard Edition

The feature is not included in the Modeler Edition or Community Edition according to the Visual Paradigm Desktop edition comparison.

For the latest edition availability and licensing information, refer to the Visual Paradigm Editions Comparison.

C++ Round-Trip Engineering: Functionality Breakdown

C++ Round-Trip Engineering consists of two complementary workflows: generating C++ code from UML models and generating or updating UML models from C++ source code. Each workflow provides different ways to work with project elements and control the synchronization process.

Generate and Update C++ Code from UML Class Models

Visual Paradigm can generate C++ source files from UML class models. When the model changes, developers can run code generation again to update the corresponding source files.

Code generation is available at three different scopes:

Generate Code for the Entire Project

Generate C++ code for all applicable classes in the current Visual Paradigm project.

This option is useful when:

  • Starting a new implementation from a complete UML design.
  • Generating source code for an entire application.
  • Updating the implementation after making changes across multiple model areas.
  • Establishing the initial mapping between UML models and source code folders.

To generate code for the entire project, use Tools > Code > Generate C++ Code… from the main menu. In the Generate Code dialog, configure the model-to-source-path mapping and generation options before proceeding.

Generate Code from an Opening Class Diagram

Generate C++ code from the classes contained in a particular open UML class diagram.

This is useful when working on a specific subsystem or when you want to generate code for a particular part of the design rather than the entire project.

To generate code from an opening class diagram:

  1. Open the UML class diagram containing the classes to generate.
  2. Right-click the diagram background.
  3. Select Utilities > C++ Round-trip > Generate Code.
  4. Specify the source path in the Generate Code dialog if required.
  5. Configure the available generation options.
  6. Click OK to generate or update the C++ source files.

Generate Code from Selected Classes

Visual Paradigm also allows developers to generate C++ code for specific UML classes instead of processing an entire project or diagram.

This is particularly useful when:

  • Implementing a new class in an existing application.
  • Updating a small group of related classes.
  • Working incrementally on a large UML model.
  • Generating code for a selected subsystem.

To generate code from selected classes:

  1. Select one or more classes in a UML class diagram.
  2. Right-click the selected classes.
  3. Select C++ Round-trip > Generate Code.
  4. Review the configured source path and generation settings.
  5. Click OK to generate or update the code.

Model-to-Source-Path Mapping

The Generate Code dialog allows developers to define how UML models map to source code directories. This mapping determines where the generated C++ files are placed.

A model is a UML element that acts as a container for other model elements, including classes and packages. Visual Paradigm uses the mapping to determine the destination folder for the code generated from the corresponding model.

The mapping configuration supports the following operations:

  • Add mapping (+): Add another model-to-source-path mapping.
  • Remove mapping (-): Remove the selected mapping.
  • Move Up: Move the selected mapping one position upward.
  • Move Down: Move the selected mapping one position downward.
  • Model: Specify the UML model whose classes and packages will be generated.
  • Source Path: Specify the destination folder for the generated source files.

Using the Root Model

The <Root> model can be used when the project does not rely on model elements to organize its classes into separate source directories, or when all classes should be generated into the same folder regardless of their parent model.

Using Multiple Model-to-Source-Path Mappings

Multiple mappings can be defined to organize generated source files according to the structure of the UML project.

For example, a project may contain separate models for its application, data access, and utility components. Each model can be mapped to a different source directory, helping preserve the intended organization of the implementation.

Advanced Code Generation Options

Visual Paradigm provides advanced code generation settings through the Advanced Options… button in the Generate Code dialog. These settings allow developers to customize generated C++ code according to project conventions and implementation requirements.

The Code Synchronization dialog organizes the available settings into four categories: Code, Brace and Indentation, New Lines, and Template.

Code Settings

The Code category controls default type assignments and source file encoding.

  • Default attribute type: Specifies the type assigned to an attribute when its type is not defined in the UML model. The documented default is int.
  • Default operation return type: Specifies the return type assigned to an operation when no return type is defined. The documented default is void.
  • Default parameter type: Specifies the type assigned to an operation parameter when its type is not defined. The documented default is int.
  • Text File Encoding: Determines the character encoding used for generated source files.

The text encoding setting provides two choices:

  • System default: Uses the default encoding of the operating system.
  • Other: Allows developers to specify another encoding for generated source files.

These default type settings are particularly useful when the UML model contains attributes, operations, or parameters without explicitly defined types.

Brace and Indentation Settings

The Brace and Indentation category controls the formatting of generated C++ declarations and code blocks.

Developers can configure the placement of opening braces for the following declarations:

  • Class declaration: Determines whether the opening brace appears on the same line as the class declaration or on the next line.
  • Constructor declaration: Controls the brace placement for constructors.
  • Method declaration: Controls the brace placement for methods.
  • Enum declaration: Controls the brace placement for enumerations.

Each of these declaration settings supports two choices:

  • Same line: Places the opening brace on the declaration line. This is the documented default.
  • Next line: Places the opening brace on the following line.

The category also provides indentation settings:

  • Indentation policy: Choose between Tabs and Spaces.
  • Indentation size: Specify the number of spaces used for indentation when the Spaces policy is selected.

These options help ensure that generated code follows the formatting conventions used by the development team.

New Lines Settings

The New Lines category controls the number of blank lines inserted between declarations in generated C++ code.

The available settings include:

  • Before first declaration: Specifies the number of blank lines before the first declaration within class declarations.
  • Before different kind declaration: Specifies the number of blank lines before a declaration of a different kind.
  • Before field declaration: Specifies the number of blank lines before field declarations.
  • Before method declaration: Specifies the number of blank lines before method declarations.

These settings help developers control the readability and visual organization of generated source code.

Template Settings

The Template category allows developers to customize templates used when generating operation bodies and getter and setter methods.

  • Operation Template: Defines the method body template applied when generating operations.
  • Getter Template: Defines the template used when generating getter methods.
  • Setter Template: Defines the template used when generating setter methods.

Getter and setter methods can be generated for attributes stereotyped as Property or for attributes with the corresponding property getter or setter option selected.

Templates are useful when generated code needs to follow consistent implementation patterns rather than relying entirely on default method bodies.

Ignore Classes During Code Generation

Visual Paradigm allows developers to exclude selected UML classes from code generation through the Ignore Classes… option in the Generate Code dialog.

This is useful when a UML model contains classes that should not produce corresponding C++ source files.

To configure the ignore list:

  1. Open the Generate Code dialog.
  2. Click Ignore Classes….
  3. In the class selection dialog, select the classes that should be excluded.
  4. Use the > control to move the selected classes into the ignore list.
  5. Click OK to confirm the selection.

The selected classes will be excluded when code generation is performed.

Generate Model Descriptions as Source Code Comments

Descriptions defined in UML model elements can be generated as comments in the corresponding C++ source code.

This allows developers to carry descriptive information from the UML model into the implementation, providing additional context for generated classes and other model elements.

Maintaining descriptions in the model can therefore help produce more informative source code and improve the connection between design documentation and implementation.

Generate and Update UML Classes from C++ Source Code

Visual Paradigm supports reverse engineering C++ source code into UML class models. This operation analyzes the specified source directories and produces UML classes or updates existing classes in the current project.

Reverse engineering is useful when the implementation already exists and developers want to create or refresh its UML representation.

To reverse engineer C++ source code:

  1. Select Tools > Code > Reverse C++ Code… from the main menu. In the Reverse Code dialog, select C++ as the language if the language selector is displayed.
  2. Specify the source paths containing the C++ code to reverse engineer.
  3. Define the corresponding source-path-to-model mappings.
  4. Choose whether to perform on-demand reverse engineering or immediately create UML classes.
  5. Click OK to proceed.

Source-Path-to-Model Mapping

The Reverse Code dialog allows developers to map source code directories to UML models.

This mapping determines where the reverse-engineered UML classes are organized within the Visual Paradigm project.

The mapping configuration supports the following operations:

  • Add mapping (+): Add a new source-path-to-model mapping.
  • Remove mapping (-): Remove the selected mapping.
  • Move Up: Move the selected mapping one position upward.
  • Move Down: Move the selected mapping one position downward.
  • Source Path: Specify the source directory containing the C++ files to reverse engineer.
  • Model: Specify the UML model that will contain the reverse-engineered classes.

Multiple mappings can be configured to organize source code from different directories into different UML models.

Using the Root Model

If the project does not use UML models to organize its classes, the <Root> model can be used as the destination for the reverse-engineered classes.

Organizing Classes into Different Models

For larger applications, developers can map different source directories to separate UML models. For example, source files belonging to a prototype implementation and those belonging to a production implementation can be placed into different models.

This provides a structured way to organize reverse-engineered classes within the Visual Paradigm project.

On-Demand Reverse Engineering

Visual Paradigm provides an on-demand reverse engineering option for handling large C++ codebases efficiently.

When Reverse source on demand is enabled, Visual Paradigm creates an index of the specified source paths rather than immediately converting all source files into UML classes.

The resulting index tree is made available in the Class Repository. Developers can browse the indexed source code and reverse engineer only the classes they need.

How On-Demand Reverse Engineering Works

  1. Open the Reverse Code dialog.
  2. Specify the source paths containing the C++ code.
  3. Ensure that Reverse source on demand is checked.
  4. Click OK to create the source indexes.
  5. Open the Class Repository and browse the resulting index tree.
  6. Locate the class or source resource you want to reverse engineer.
  7. Right-click the selected resource and choose Reverse Resources.
  8. Choose either New Class Diagram or Class Repository as the destination.

The two destination choices provide different ways to organize the resulting UML classes:

  • New Class Diagram: Reverse the selected resources into UML classes and create a new class diagram containing them.
  • Class Repository: Reverse the selected resources into UML classes in the model repository.

When Should You Use On-Demand Reverse Engineering?

On-demand reverse engineering is particularly useful when working with large applications containing many source files and classes.

For example, if a C++ project contains thousands of source files but you only need to understand a small subsystem, reversing the entire codebase may require unnecessary processing time.

By creating indexes first and reversing selected resources later, developers can focus on the relevant parts of the implementation and significantly reduce the initial reverse engineering workload.

Reverse Source on Demand: Enabled vs. Disabled

Setting Behavior Suitable Scenario
Enabled (checked) Creates source indexes instead of immediately producing UML classes. Selected resources can be reversed later. Large codebases or selective reverse engineering.
Disabled (unchecked) Performs actual reverse engineering and creates or updates UML classes from the specified source paths. Updating the UML model directly from source code.

Update UML Classes on a Class Diagram from C++ Code

After round-trip engineering has been performed at least once, Visual Paradigm allows developers to update the classes on an existing class diagram using the corresponding C++ source code.

To update an entire class diagram:

  1. Open the class diagram containing the UML classes to update.
  2. Right-click the diagram background.
  3. Select Utilities > C++ Round-trip > Reverse Code.
  4. Visual Paradigm updates the UML classes based on the corresponding source code.

Important: This diagram-level update operation requires that round-trip engineering has already been performed at least once and that the class diagram contains at least one class.

Update Selected UML Classes from C++ Code

Developers can also update individual UML classes or a selected group of classes without processing every class in the diagram.

To update selected classes:

  1. Open the relevant UML class diagram.
  2. Select the UML class or classes that need updating.
  3. Right-click the selected classes.
  4. Select C++ Round-trip > Reverse Code.
  5. Visual Paradigm updates the selected UML classes using their corresponding source code.

This workflow is useful when only a few classes have changed and developers want to synchronize those classes without updating the entire diagram.

C++ Round-Trip Operations at a Glance

Operation Input Output Primary Purpose
Generate code for the project UML project model C++ source files Generate or update code across the project.
Generate code from a diagram Opening UML class diagram C++ source files Generate or update code for classes in a diagram.
Generate code from selected classes Selected UML classes C++ source files Generate or update code for specific classes.
Reverse code C++ source directories UML classes Create or update UML models from source code.
On-demand reverse C++ source directories Source indexes Index source code for selective reverse engineering.
Reverse code from diagram Existing UML class diagram and mapped source code Updated UML classes Synchronize an entire diagram with implementation changes.
Reverse code from selected classes Selected UML classes and mapped source code Updated UML classes Synchronize specific classes with implementation changes.

How to Use C++ Round-Trip Engineering in Visual Paradigm

The following workflows demonstrate how to use C++ Round-Trip Engineering in typical software development scenarios.

Workflow: Generate C++ Source Code from a UML Class Diagram

Use this workflow when you have designed your application using UML class diagrams and want to generate the corresponding C++ source files.

  1. Prepare the UML class model. Create or open a Visual Paradigm project containing the classes you want to implement. Define the class names, attributes, operations, and relationships as appropriate.
  2. Open the class diagram. Review the diagram and ensure that the model represents the intended application structure.
  3. Open the code generation command. Select Tools > Code > Generate C++ Code… from the main menu to generate code for the project.
  4. Configure the output path. In the Generate Code dialog, specify where the generated C++ source files should be stored. Configure the model-to-source-path mapping as required.
  5. Customize generation settings. Optionally open Advanced Options to configure default types, source file encoding, brace placement, indentation, blank lines, and code templates.
  6. Exclude unnecessary classes. If some UML classes should not produce source files, configure the Ignore Classes list.
  7. Generate the source code. Click OK to generate the C++ source files.
  8. Review the generated files. Open the output directory and inspect the generated source files before continuing with implementation.

After generation, developers can open the source files in their preferred C++ development environment and continue implementing the application.

Workflow: Update UML Models from Modified C++ Code

Use this workflow when developers have modified the generated C++ source code and want to reflect those changes in the UML class model.

  1. Modify the C++ source code. Open the relevant source file in a text editor or C++ IDE and make the required changes. For example, add an attribute, modify an operation, or update a class definition.
  2. Save the source file. Ensure that all implementation changes have been saved.
  3. Open Visual Paradigm. Open the project containing the original UML class model.
  4. Open the Reverse Code dialog. Select Tools > Code > Reverse C++ Code… from the main menu.
  5. Configure source paths and model mappings. Specify the directories containing the modified C++ files and map them to the appropriate UML model.
  6. Disable on-demand reverse engineering for immediate synchronization. Uncheck Reverse source on demand if you want Visual Paradigm to reverse the source code directly into UML classes rather than creating an index tree.
  7. Reverse the source code. Click OK to process the specified source files.
  8. Review the updated UML model. Open the relevant class diagram and verify that the changes have been reflected in the UML classes.

For example, adding two private integer attributes, x and y, to a C++ class can result in the corresponding UML class being updated with the attributes -x : int and -y : int.

Workflow: Reverse Engineer a Large C++ Codebase Selectively

When working with a large C++ application, reversing every source file immediately may be unnecessary. On-demand reverse engineering provides a more selective approach.

  1. Open the Reverse Code dialog. Select Tools > Code > Reverse C++ Code….
  2. Specify the source directories. Add the directories containing the C++ source files you want to index.
  3. Configure model mappings. Map the source directories to the appropriate UML models.
  4. Enable on-demand reverse engineering. Ensure that Reverse source on demand is checked.
  5. Create the source indexes. Click OK to process the specified paths and build the index tree.
  6. Browse the Class Repository. Locate the source resources you want to understand or document.
  7. Select the relevant resources. Right-click the classes or resources you want to reverse engineer.
  8. Choose the destination. Select Reverse Resources and choose either New Class Diagram or Class Repository.
  9. Review the resulting UML classes. Continue working with the selected classes in the model repository or class diagram.

This approach is particularly useful for legacy applications and large codebases where only selected components need to be modeled.

Practical Use Cases

Design-Driven C++ Development

Software architects can begin by defining an application’s structure in UML class diagrams. Developers can then generate C++ source files from the model and continue implementing the business logic.

When the design changes, code generation can be performed again to update the implementation.

Legacy C++ System Documentation

When inheriting an existing C++ application with limited documentation, developers can reverse engineer its source code into UML class models. The resulting diagrams provide a visual starting point for understanding the application’s structure.

Maintaining Existing Applications

As an application evolves, developers may add attributes, modify operations, or change class structures directly in the source code. Reverse engineering helps bring those changes into the UML model.

Architecture Analysis and Refactoring

Before restructuring an existing C++ application, developers can reverse engineer relevant source files to obtain a UML representation of the current implementation. This model can be used to discuss the existing design and plan architectural changes.

Selective Documentation of Large Systems

On-demand reverse engineering helps teams focus on specific classes or components instead of immediately creating UML classes for an entire codebase.

Best Practices for C++ Round-Trip Engineering

Establish the Source Path Mapping Carefully

Configure the model-to-source-path and source-path-to-model mappings consistently. Correct mappings are important for ensuring that generated source files and reverse-engineered UML classes are associated with the intended model elements.

Use Consistent Model Organization

Organize UML classes into meaningful models and packages where appropriate. This makes it easier to map different parts of a C++ application to their corresponding source directories.

Review Advanced Generation Settings

Before generating code for a project, review the default types, file encoding, indentation, brace placement, blank-line settings, and templates. Consistent settings help keep generated code aligned with the development team’s conventions.

Use On-Demand Reverse Engineering for Large Projects

When a project contains a large number of C++ source files, consider indexing the code first and selectively reversing the classes required for the current task.

Keep the UML Model and Source Code in a Consistent Location

Maintain clear source directory structures and ensure that the paths used during code generation and reverse engineering continue to refer to the intended project files.

Review Changes After Synchronization

After generating or reversing code, inspect the resulting source files or UML classes to ensure that the changes are represented as expected. This is especially important when working with complex or existing applications.

Back Up Important Project and Source Files

Before performing large-scale code generation or reverse engineering, keep appropriate backups of the Visual Paradigm project and C++ source files. This provides a recovery point if the resulting changes are not what you intended.

Important Considerations

Although C++ Round-Trip Engineering helps synchronize UML models and source code, there are several important considerations when using the feature.

Round-Trip Engineering Is an Explicit Workflow

Generating code or reversing source code is an operation initiated by the user. Developers should not assume that changes made in an external C++ editor are automatically reflected in Visual Paradigm without performing the relevant reverse engineering operation.

On-Demand Reverse Engineering Does Not Immediately Create All UML Classes

When Reverse source on demand is enabled, Visual Paradigm indexes the specified source paths instead of immediately creating all UML classes. Developers must subsequently select the required resources and reverse them into UML models.

Model and Source Path Mappings Matter

The mappings determine where generated files are placed and where reverse-engineered classes are organized. Incorrect or outdated mappings can prevent the intended model and source directories from being processed together.

Code Generation and Reverse Engineering Serve Different Purposes

Code generation transforms UML model information into source code. Reverse engineering extracts structural information from source code and represents it in UML. These operations are complementary, but they are not interchangeable.

Generated Code Is Not a Compiled Application

C++ Round-Trip Engineering generates or updates source code and UML models. It does not replace a C++ compiler, build system, linker, debugger, or application testing environment. Developers remain responsible for compiling, testing, and validating their implementation.

Review Language and Project Compatibility

Visual Paradigm’s C++ round-trip documentation describes ANSI C++ code engineering. Developers working with projects that depend on advanced language features, specialized compiler extensions, or complex implementation constructs should validate the results against their actual codebase and toolchain.

Frequently Asked Questions About C++ Round-Trip Engineering

What is C++ Round-Trip Engineering in Visual Paradigm?

C++ Round-Trip Engineering is a Visual Paradigm Desktop feature that supports two-way synchronization between UML class models and C++ source code. It allows developers to generate or update C++ source files from UML classes and reverse engineer C++ source code into UML classes.

Which Visual Paradigm editions support C++ Round-Trip Engineering?

C++ Round-Trip Engineering is available in Visual Paradigm Desktop Enterprise, Professional, and Standard editions. It is not listed as available in the Modeler or Community editions.

Can Visual Paradigm generate C++ code from a UML class diagram?

Yes. Visual Paradigm can generate C++ source code from an entire project, an opening class diagram, or selected UML classes.

Can Visual Paradigm reverse engineer C++ source code into UML class diagrams?

Yes. Visual Paradigm can reverse engineer C++ source code into UML classes. The resulting classes can be organized in the model repository and displayed in UML class diagrams.

Can I update existing C++ code after changing a UML class diagram?

Yes. Use the Generate Code operation to generate or update C++ source files based on the UML class model. Visual Paradigm supports generation at the project, diagram, and selected-class levels.

Can I update a UML class diagram after modifying C++ source code?

Yes. Use Reverse C++ Code to update the UML model from the modified source code. You can reverse source code directly into UML classes or use the diagram-level and selected-class reverse operations after round-trip engineering has been established.

Does C++ Round-Trip Engineering support both forward and reverse engineering?

Yes. Forward engineering generates or updates C++ code from UML class models, while reverse engineering generates or updates UML classes from C++ source code.

Can I generate C++ code for only selected classes?

Yes. Select the required UML classes, right-click them, and select C++ Round-trip > Generate Code. This allows you to generate code for specific classes without processing the entire project.

Can I generate C++ code for an entire Visual Paradigm project?

Yes. Select Tools > Code > Generate C++ Code… from the main menu to generate or update code for the project.

Can I generate C++ code from an opening class diagram only?

Yes. Right-click the background of the opening class diagram and select Utilities > C++ Round-trip > Generate Code.

What is the purpose of model-to-source-path mapping?

Model-to-source-path mapping determines where C++ files generated from a particular UML model are stored. It allows different UML models to be associated with different source directories.

What is the purpose of source-path-to-model mapping?

Source-path-to-model mapping determines which UML model receives the classes reverse-engineered from a specified C++ source directory.

Can I define multiple source path mappings?

Yes. Both the Generate Code and Reverse Code workflows support multiple mappings. This allows developers to organize different UML models and source directories independently.

What does the <Root> model mean in the mapping configuration?

The <Root> model represents the root of the UML project hierarchy. It can be used when developers do not need to organize generated or reverse-engineered classes under specific UML models, or when they want to process classes without separating them by parent model.

What is Reverse source on demand?

Reverse source on demand is an option in the Reverse Code dialog. When enabled, Visual Paradigm indexes the specified source directories rather than immediately converting all source files into UML classes. Developers can subsequently select individual resources from the Class Repository and reverse them as needed.

Should I enable or disable Reverse source on demand?

Enable it when working with large codebases or when you only need to reverse selected classes. Disable it when you want Visual Paradigm to perform actual reverse engineering and create or update UML classes directly from the specified source paths.

Does on-demand reverse engineering create UML classes immediately?

No. When Reverse source on demand is checked, Visual Paradigm creates indexes of the source code. UML classes are created later when developers select the indexed resources and perform the Reverse Resources operation.

Where can I find the indexed C++ classes after on-demand reverse engineering?

The indexed source resources are available in the Class Repository. Developers can browse the index tree, select the required resources, and reverse them into UML classes.

What is the difference between New Class Diagram and Class Repository when reversing resources?

Both options reverse selected indexed resources into UML classes. New Class Diagram creates a new class diagram and places the resulting classes in it, while Class Repository reverses the selected resources into the model repository.

Can I update only selected UML classes from C++ code?

Yes. Select the UML classes in a class diagram, right-click them, and select C++ Round-trip > Reverse Code. This allows you to update specific classes rather than the entire diagram.

Can I update all UML classes on a class diagram from C++ code?

Yes. After performing round-trip engineering at least once, right-click the class diagram background and select Utilities > C++ Round-trip > Reverse Code. The diagram must contain at least one class.

Why is the diagram-level Reverse Code command unavailable?

The diagram-level update operation requires that round-trip engineering has already been performed at least once and that the class diagram contains at least one class. Verify both conditions before attempting the operation.

What is the Ignore Classes option used for?

Ignore Classes allows developers to exclude selected UML classes from code generation. Classes added to the ignore list will not have corresponding code generated during that operation.

Can Visual Paradigm generate code using custom formatting?

Yes. The Advanced Options dialog provides settings for brace placement, indentation, blank lines, text file encoding, and code templates. These options help developers customize the formatting of generated C++ code.

What happens if an attribute has no type defined in the UML model?

Visual Paradigm uses the configured Default attribute type when generating code. The documented default is int. Developers can change this setting in the Code category of Advanced Options.

What happens if an operation has no return type defined?

Visual Paradigm uses the configured Default operation return type. The documented default is void.

What happens if an operation parameter has no type defined?

Visual Paradigm uses the configured Default parameter type. The documented default is int.

Can I customize generated getter and setter methods?

Yes. The Template category provides Getter Template and Setter Template settings. These templates apply to attributes stereotyped as Property or configured with the corresponding property getter or setter option.

Can I customize generated method bodies?

Yes. The Operation Template setting allows developers to define a template for method bodies generated from UML operations.

Can UML descriptions be included in generated C++ code?

Yes. Descriptions defined in UML model elements are generated as comments in the corresponding source code.

Does C++ Round-Trip Engineering automatically compile the generated code?

No. C++ Round-Trip Engineering generates and updates source files and UML models. Compilation and application execution must be performed using an appropriate C++ development toolchain.

Is C++ Round-Trip Engineering the same as Instant Reverse?

No. C++ Round-Trip Engineering provides two-way synchronization between UML class models and C++ source code. Instant Reverse is a separate reverse engineering capability for importing source code into UML models without providing the same model-to-code round-trip workflow.

Is C++ Round-Trip Engineering a continuous background synchronization service?

No. It is an explicit code engineering workflow. Developers initiate code generation or reverse engineering when they want to synchronize the UML model and source code.

Can C++ Round-Trip Engineering be used for legacy applications?

Yes. It can be useful for documenting and understanding existing C++ applications. Developers can reverse engineer the source code into UML models and use on-demand reverse engineering to focus on selected components of large codebases.

Summary

C++ Round-Trip Engineering in Visual Paradigm Desktop provides an integrated approach to maintaining consistency between UML class models and C++ source code. By combining forward code generation with reverse engineering, it supports both design-driven development and the documentation of existing implementations.

Its capabilities include project-wide code generation, diagram-level and selected-class generation, configurable source path mappings, advanced code formatting and templates, class exclusion, direct reverse engineering, on-demand source indexing, and selective UML class updates.

Whether you are developing a new C++ application, maintaining an existing system, or documenting a large codebase, Visual Paradigm’s C++ Round-Trip Engineering helps bridge the gap between software design and implementation.

Scroll to Top