Instant Code Reverse: XML is a code reverse-engineering feature in Visual Paradigm Desktop that transforms XML source files into UML class models. It allows developers and software architects to bring the structural information represented in XML documents into a visual modeling environment, making it easier to understand data structures, examine relationships, and create UML class diagrams for analysis and documentation.
Instead of manually creating UML classes based on the contents of XML files, users can use Instant Reverse to process XML source files and generate corresponding model elements in a Visual Paradigm project. Once the reverse-engineering process is complete, users can select the generated classes and create class diagrams to visualize the resulting model.
The feature is particularly useful when working with existing XML-based systems, legacy applications, data exchange documents, and projects where developers need to understand or document structures that are already represented in XML.
Why Use Instant Code Reverse: XML?
XML documents can contain extensive hierarchical structures and interconnected data definitions. Although these structures can be examined directly in XML editors, understanding their overall organization and representing them in a visual model can be more challenging.
Visual Paradigm’s Instant Code Reverse: XML helps bridge this gap by converting XML source information into UML class models that can be explored and further developed.
Understand Existing XML Structures Visually
Transform XML source information into UML class models to make structural information easier to explore and communicate. A visual model provides an alternative perspective to reading XML markup directly.
Accelerate UML Model Creation
Automatically reverse-engineer model elements from XML files rather than creating every class manually. This provides a starting point for further modeling and documentation.
Analyze Existing Systems
Bring existing XML-based structures into a UML modeling environment to support system analysis, maintenance, and architectural review. Developers can examine the resulting classes and organize them into meaningful diagrams.
Support Legacy System Documentation
When maintaining an existing system, documentation may be incomplete or outdated. Reverse engineering XML files can help teams establish a visual representation of existing structures as a basis for documentation and further investigation.
Organize Models Within a Visual Paradigm Project
Reversed classes can be placed under a selected model in the project. This makes it possible to separate imported structures from other project content, such as existing designs, legacy components, and prototype models.
Edition and Availability
Instant Code Reverse: XML is a code engineering feature available in the following Visual Paradigm Desktop editions:
- Enterprise Edition
- Professional Edition
- Standard Edition
The feature is not included in Modeler Edition or Community Edition according to the Visual Paradigm Desktop edition comparison.
For the latest edition information, refer to the Visual Paradigm Editions Comparison.
Understanding XML Reverse Engineering
What Does Reverse Engineering XML Mean?
Reverse engineering XML means processing existing XML source files to produce UML model elements in Visual Paradigm. Rather than starting with a UML design and generating XML-related output, this workflow starts with existing XML input and derives a visual model from it.
The resulting UML classes can be inspected in the project, organized under a model, and used to form class diagrams.
XML Versus XML Schema (XSD)
Visual Paradigm provides separate Instant Reverse options for XML and XML Schema. Although both are related to XML technologies, they represent different reverse-engineering inputs and should not be confused.
| Aspect | XML | XML Schema (XSD) |
|---|---|---|
| Input | XML source files | XML Schema definition files (.xsd) |
| Purpose | Reverse-engineer UML classes from XML files. | Reverse-engineer UML classes from XML Schema definitions. |
| Workflow | Select XML as the language in Instant Reverse. | Select XML Schema as the language in Instant Reverse. |
| Result | UML class model elements that can be used to form class diagrams. | UML class model elements that can be used to form class diagrams. |
Important: If your source files are XML Schema definitions (.xsd), select XML Schema rather than XML in the Instant Reverse window. The two options are separate reverse-engineering workflows.
Functionality Breakdown
Instant Code Reverse: XML provides several capabilities throughout the reverse-engineering workflow, from selecting source files and organizing generated model elements to forming UML class diagrams.
XML Language Selection
The Language option identifies the source type that Visual Paradigm should reverse-engineer. To reverse XML documents, select XML in the Instant Reverse window.
This tells Visual Paradigm to process the supplied source as XML rather than another supported code or data-definition format.
XML Source File and Folder Selection
The Path option specifies the location of the XML source to be reverse-engineered. Users can provide the path to an individual source file or a folder containing the source files.
This allows the workflow to be used for both individual XML documents and collections of XML files.
- Single-file reverse engineering: Specify an XML file when you want to process a particular document.
- Folder-based reverse engineering: Specify a folder when you want to process XML source files stored together.
Duplicate Class Handling
The Update Type option determines how Visual Paradigm handles classes that already exist in the project when the reverse-engineering process encounters duplicate classes.
Two update behaviors are available:
- Update duplicate class(es): Update existing classes using the information from the source being reversed. This is useful when you want to refresh existing model elements based on updated source files.
- Replace duplicate class(es): Discard existing duplicate classes and overwrite them with the classes produced from the reversed source. This is useful when you want the reversed source to replace the existing class definitions.
These options are important when importing XML into a project that already contains model elements with matching class identities. Choose the appropriate behavior based on whether you want to update existing classes or replace them.
Reverse to Model
The Reverse to Model option determines where Visual Paradigm places the classes generated during reverse engineering.
Users can choose an existing model or create a new model to contain the reversed classes. This is particularly useful for organizing different versions or categories of system structures within one project.
For example:
- Legacy: Place classes reversed from an existing legacy system under a model named Legacy.
- Prototype: Place classes from an experimental XML implementation under a separate Prototype model.
- Imported XML: Create a dedicated model to keep imported XML structures separate from manually designed UML elements.
To configure the destination model, click the ellipsis (…) button beside Reverse to Model. In the Select Parent Model window, select an existing model or click New Model to create one. Click OK to confirm the selection.
Instant Reverse Execution
After configuring the source language, input path, duplicate-class handling, and destination model, click OK in the Instant Reverse window to start the reverse-engineering operation.
Visual Paradigm processes the selected XML source and creates the corresponding UML class model elements in the project.
Form Class Diagram
After reverse engineering completes, Visual Paradigm displays the Instant Reverse Form Diagram window. This window allows users to select the reversed classes and generate a UML class diagram from them.
The diagram-generation workflow provides control over which classes appear in the diagram, which related elements and relationships are included, and how class attributes and operations are presented.
Users can also choose not to create a diagram immediately. The reversed classes remain available in the project and can be used to form diagrams later.
Class Selection
The Select Class tab displays a tree containing the classes generated during reverse engineering.
Users can select the classes they want to include in the new class diagram. At least one class must be selected to proceed with diagram generation.
For large XML sources, it is advisable to select only the classes relevant to the intended analysis. Selecting too many classes can make diagram generation computationally expensive and produce diagrams that are difficult to read.
Form Diagram Options
The Form Diagram Options control which related model elements and relationships Visual Paradigm includes when generating the class diagram.
These options help users expand a diagram beyond the initially selected classes to show relevant inheritance, interface implementation, associations, and containment relationships.
| Option | Description |
|---|---|
| Show superclasses | Displays the generalization relationships between the selected classes and their superclasses (ancestors). |
| Show subclasses | Displays the generalization relationships between the selected classes and their subclasses (descendants). |
| Show suppliers (interface) | Displays realization relationships between the selected elements and their supplier interfaces. |
| Show clients | Displays realization relationships between the selected elements and their clients, meaning classes that implement the selected interfaces. |
| Show navigable classes | Displays association relationships between the selected elements and their navigable classes (association targets). |
| Show non-navigable classes | Displays association relationships between the selected elements and their non-navigable classes (association sources). |
| Show containers | Displays containment relationships between the selected elements and their containers, such as packages. |
| Show residents | Displays elements contained within the selected elements or containers. The available depth choices include Single level only, All levels in single diagram, and All levels in sub diagrams. |
| Show as containment relationships | Displays containment relationships between classes as connectors in the generated diagram. |
The Show residents option provides additional control over how deeply contained elements are displayed:
- Single level only: Shows residents at one level only.
- All levels in single diagram: Shows residents at all levels in one diagram.
- All levels in sub diagrams: Shows residents at all levels across multiple single-level diagrams.
These settings allow users to balance diagram completeness against visual complexity. For example, showing all levels in one diagram can provide a comprehensive view, while using sub diagrams can help keep large structures more manageable.
Presentation Options
The Presentation Options control how class attributes, operations, and data types appear in the generated class diagram.
Attribute Options
These options determine which attributes are displayed in the generated class shapes.
- Show all: Displays all attributes of the classes.
- Public only: Displays public attributes only.
- Hide all: Hides all attributes.
- Initial values: Displays the initial values of attributes.
Operation Options
These options determine which operations are displayed in the generated class shapes.
- Show all: Displays all operations of the classes.
- Public only: Displays public operations only.
- Hide all: Hides all operations.
- Initial values: Displays the initial values of operations.
Type Options
These options determine how data types are represented in the class diagram.
- Fully-qualified: Displays fully qualified type names.
- Name only: Displays only the type names.
- Relative: Displays type names relative to the current class.
By adjusting these presentation settings, users can create diagrams that emphasize different aspects of the reversed model. For example, a high-level overview may benefit from hiding attributes and operations, while a detailed technical diagram may require showing all available class members and fully qualified types.
Show This Window After Instant Reverse
The Instant Reverse Form Diagram window includes a Show this window after instant reverse setting.
When this setting is unchecked, Visual Paradigm will no longer display the diagram-formation window automatically after subsequent Instant Reverse operations. This is useful when users prefer to reverse source files first and create diagrams manually at a later stage.
How to Use Instant Code Reverse: XML
Follow these steps to reverse-engineer XML files into UML class models using Visual Paradigm Desktop.
Open the Instant Reverse Feature
- Open your Visual Paradigm Desktop project.
- From the main menu, select Tools > Code > Instant Reverse…
- The Instant Reverse window will appear.
Select XML as the Source Language
- In the Language field, select XML.
- Make sure you select XML rather than XML Schema if you are reversing XML documents rather than XSD definition files.
Specify the XML Source Path
- Specify the path to the XML source file you want to reverse.
- Alternatively, specify the folder containing the XML source files you want to process.
- Verify that the selected path points to the intended source.
Configure the Update Type
- Choose the appropriate Update Type for handling duplicate classes.
- Select Update duplicate class(es) if you want to update existing classes using the reversed source.
- Select Replace duplicate class(es) if you want existing duplicate classes to be discarded and replaced by the reversed source.
Select the Destination Model
- Locate the Reverse to Model option.
- Click the ellipsis (…) button beside it.
- In the Select Parent Model window, select an existing model or click New Model to create a new one.
- Click OK to confirm your selection.
Run Instant Reverse
- Review the selected language, source path, update type, and destination model.
- Click OK in the Instant Reverse window.
- Allow Visual Paradigm to process the XML source and generate the UML class model elements.
Generate a Class Diagram
- After the reverse-engineering process finishes, the Instant Reverse Form Diagram window appears.
- In the Select Class tab, choose the classes you want to visualize.
- Configure the Form Diagram Options to control the related elements and relationships included in the diagram.
- Configure the Presentation Options to determine how attributes, operations, and types are displayed.
- Click OK to generate the class diagram.
If you do not want to generate a class diagram immediately, click Cancel. This closes the diagram-formation workflow without removing the reversed classes from the project. You can locate the classes in Model Explorer or Class Repository and form a diagram manually later.
Practical Workflows and Use Cases
Reverse an Individual XML Document
When you need to understand a particular XML document, use its file path as the reverse-engineering input. Select XML as the language, configure the destination model, and execute Instant Reverse. You can then select the resulting classes and form a class diagram for further examination.
Reverse Multiple XML Files from a Folder
When working with a collection of XML source files, specify the folder containing those files instead of selecting an individual file. This provides a convenient way to process a group of XML sources within one reverse-engineering workflow.
Keep Legacy and New Structures Separate
When comparing existing and newly developed systems, create separate destination models for their reversed classes. For example, place existing XML structures under a Legacy model and newly developed structures under a Prototype model. This helps maintain a clear distinction between different sets of model elements within the same project.
Refresh Existing UML Classes from XML
When XML source information changes and you need to update the corresponding model elements, use the Update duplicate class(es) behavior. This updates existing duplicate classes using the reversed source, helping you maintain a more current model.
Replace Existing Classes with Reversed Source
If you want the reversed source to replace existing duplicate classes, select Replace duplicate class(es). This discards the existing duplicates and overwrites them with the classes produced from the XML source. Use this option carefully when the existing model contains changes that you do not want to lose.
Create Focused Class Diagrams
For large reversed models, select only the classes relevant to a particular analysis. Use the relationship options to include relevant related elements, and adjust the presentation settings to avoid displaying unnecessary details. This helps produce diagrams that are easier to understand and maintain.
Working with Reversed Classes After Import
Reverse engineering and diagram generation are separate stages. Completing Instant Reverse creates model elements in the project, while forming a class diagram provides a visual representation of selected elements.
Locate Reversed Classes
After reverse engineering, users can find the generated classes in Visual Paradigm’s Model Explorer or Class Repository. These project views allow users to locate model elements even when no class diagram was generated immediately after the reverse operation.
Create Diagrams Later
If you selected Cancel in the Instant Reverse Form Diagram window, the reversed classes remain available for subsequent modeling. You can locate the classes and manually add them to a class diagram when needed.
Use Different Diagrams for Different Analysis Purposes
A reversed model can serve as the foundation for multiple diagrams. For example, one diagram can focus on selected classes and their immediate relationships, while another can provide a broader view of related classes and containment structures.
Best Practices and Recommendations
- Choose the correct source language. Select XML for XML documents and XML Schema for XSD files. Selecting the wrong source type can prevent you from using the intended reverse-engineering workflow.
- Organize imported elements. Use Reverse to Model to place reversed classes in an appropriate model rather than mixing imported structures indiscriminately with other project elements.
- Choose the duplicate handling strategy carefully. Understand the difference between updating and replacing duplicate classes before starting the operation.
- Review the selected classes before forming diagrams. Selecting a large number of classes can make diagram generation costly. Start with the classes relevant to your analysis.
- Use relationship options selectively. Include only the relevant related elements to keep diagrams understandable.
- Adjust presentation settings to suit the audience. Use simplified class presentations for overview diagrams and more detailed presentations for technical analysis.
- Do not confuse reverse engineering with diagram generation. Cancelling the diagram-formation window does not remove the reversed classes from the project.
- Keep a backup of important project data. In particular, review the impact of Replace duplicate class(es) before using it on an existing project.
Limitations and Important Considerations
XML Reverse Engineering Is Not XML Schema Reverse Engineering
XML and XML Schema are separate source types in Visual Paradigm. If your input consists of XSD files, use the XML Schema option. Do not assume that selecting XML will perform the same operation as reversing an XML Schema definition.
Reverse Engineering Does Not Automatically Mean Diagram Creation
Instant Reverse creates UML model elements. The class diagram is generated through a subsequent step in the Instant Reverse Form Diagram window. Users can skip this step and create diagrams later.
Diagram Generation Depends on Class Selection
Users must select at least one class in the Select Class tab to form a class diagram. Selecting too many classes may make the operation computationally expensive.
Duplicate Handling Can Affect Existing Model Elements
The Update duplicate class(es) and Replace duplicate class(es) options have different effects on existing duplicate classes. Users should choose the appropriate option based on whether existing classes should be updated or discarded and replaced.
Diagram Presentation Is Configurable
The generated class diagram does not have to display every available attribute, operation, type detail, or relationship. Users can configure the diagram-formation options to control the amount of information displayed.
Frequently Asked Questions
What is Instant Code Reverse: XML in Visual Paradigm?
Instant Code Reverse: XML is a Visual Paradigm Desktop feature that reverse-engineers XML source files into UML class model elements. Users can then select the reversed classes and generate UML class diagrams.
What is the purpose of reversing XML into UML?
The purpose is to transform existing XML source information into a visual UML model. This helps developers understand existing structures, examine model elements, create documentation, and perform further system analysis.
Which Visual Paradigm editions support Instant Code Reverse: XML?
Instant Code Reverse: XML is supported in Visual Paradigm Desktop Enterprise, Professional, and Standard editions. It is not listed as available in Modeler or Community editions.
How do I reverse an XML file in Visual Paradigm Desktop?
Select Tools > Code > Instant Reverse…, choose XML as the Language, specify the XML source file or folder, configure the Update Type and Reverse to Model options, and click OK. After reversing, you can select classes and generate a class diagram.
Can I reverse multiple XML files at once?
Yes. You can specify a folder containing XML source files as the input path instead of selecting an individual XML file.
Can I reverse XML into a UML class diagram?
Yes. Instant Reverse first generates UML class model elements from XML source files. After the reverse operation, the Instant Reverse Form Diagram window allows you to select classes and generate a UML class diagram.
Does Instant Reverse automatically create a class diagram?
Visual Paradigm displays the Instant Reverse Form Diagram window after the reverse-engineering operation. Users can select classes and click OK to create a diagram, or click Cancel to skip diagram creation and create diagrams later.
What happens if I click Cancel in the Instant Reverse Form Diagram window?
Clicking Cancel only skips the immediate class diagram creation step. It does not delete the reversed classes. You can still find them in Model Explorer or Class Repository and create diagrams manually later.
What is the difference between Update duplicate class(es) and Replace duplicate class(es)?
Update duplicate class(es) updates existing classes using the reversed source. Replace duplicate class(es) discards existing duplicate classes and overwrites them with the classes generated from the reversed source.
What does Reverse to Model do?
Reverse to Model specifies the destination model in which Visual Paradigm places the reversed classes. You can select an existing model or create a new model through the Select Parent Model window.
Can I create a new model for reversed XML classes?
Yes. Click the ellipsis button beside Reverse to Model, then click New Model in the Select Parent Model window. Confirm your selection by clicking OK.
Can I reverse XML Schema files using the XML option?
No. XML Schema files (.xsd) have a separate Instant Reverse language option. Select XML Schema when reversing XSD files.
What is the difference between XML and XML Schema reverse engineering?
XML reverse engineering processes XML source files, while XML Schema reverse engineering processes XML Schema definition files (.xsd). Both workflows generate UML class model elements, but they use different source-language selections.
What does Show superclasses do when forming a class diagram?
Show superclasses includes the generalization relationships between selected classes and their ancestors in the generated class diagram.
What does Show subclasses do when forming a class diagram?
Show subclasses includes the generalization relationships between selected classes and their descendants in the generated class diagram.
What does Show suppliers (interface) do?
Show suppliers (interface) displays realization relationships between selected elements and their supplier interfaces.
What does Show clients do?
Show clients displays realization relationships between selected elements and the classes that implement the selected interfaces.
What is the difference between Show navigable classes and Show non-navigable classes?
Show navigable classes displays association relationships with navigable target classes, while Show non-navigable classes displays association relationships with non-navigable source classes.
What does Show containers do?
Show containers displays containment relationships between selected elements and their containing elements, such as packages.
What does Show residents do?
Show residents controls whether contained elements are displayed in the generated class diagram. Users can show one level of residents, all levels in one diagram, or all levels across multiple sub diagrams.
What does Show as containment relationships do?
It displays containment relationships between classes as connectors in the generated diagram.
Can I hide attributes when generating a class diagram?
Yes. In Presentation Options, set Attribute options to Hide all. You can also choose Show all, Public only, or Initial values.
Can I hide operations when generating a class diagram?
Yes. In Presentation Options, set Operation options to Hide all. Other available choices include Show all, Public only, and Initial values.
How can I display fully qualified data types?
In Presentation Options, set Type options to Fully-qualified. You can alternatively select Name only or Relative.
Can I stop Visual Paradigm from displaying the Form Diagram window after every reverse operation?
Yes. Uncheck Show this window after instant reverse in the Instant Reverse Form Diagram window. The window will no longer be displayed automatically after subsequent Instant Reverse operations.
Where can I find reversed classes if I did not create a diagram?
You can locate reversed classes in Model Explorer or Class Repository. From there, you can use the model elements to create diagrams manually.
Can I reverse XML into a package diagram?
The documented XML reverse-engineering workflow generates UML class model elements and provides a class diagram formation step. The XML Schema workflow has a separate documented option for reverse-engineering package diagrams. Do not assume that the XML workflow provides the same package diagram option.
Is Instant Code Reverse: XML the same as XML code generation?
No. Instant Reverse is a reverse-engineering operation that starts with existing XML source files and produces UML class model elements. Code generation works in the opposite direction by producing source output from a model.
Summary
Visual Paradigm Desktop’s Instant Code Reverse: XML provides a practical way to transform existing XML source files into UML class models. By automating the initial model creation process, it helps developers and software architects examine existing structures, organize imported classes, and create visual representations for analysis and documentation.
With configurable duplicate-class handling, destination model selection, class selection, relationship inclusion, and presentation options, users can control how reversed XML structures are incorporated into their projects and visualized in class diagrams.
Whether you are examining an existing XML document, documenting a legacy system, or building a UML representation of existing data structures, Instant Code Reverse: XML provides a convenient starting point for bringing XML source information into a structured visual modeling environment.
VISUAL PARADIGM