Using the Instant Generator, you can select UML classes from diagrams or the project model, configure code generation settings, specify an output directory, preview generated code, and produce ODL files. You can also customize the generation templates to control aspects of the generated source code.
1. What Is the ODL Instant Code Generator?
The ODL Instant Code Generator is a code engineering feature in Visual Paradigm Desktop that generates Object Definition Language (ODL) source code from UML class models. It is part of Visual Paradigm’s Instant Generator functionality, which converts selected model elements into source files for further development.
Instead of manually translating a UML class diagram into ODL declarations, developers can use the generator to produce an initial source-code representation from their existing model. This makes the UML class model a practical starting point for implementation work.
Where Does It Fit in Visual Paradigm?
The ODL generator belongs to Visual Paradigm Desktop’s Code Engineering toolset. Code Engineering provides capabilities for transforming software models into source code and, for certain supported languages and workflows, reverse-engineering source code into UML models.
ODL generation specifically uses the Instant Generator. It is a model-to-code operation: users select the desired UML classes, configure the generator, and produce ODL source files.
What Does It Generate?
The generator produces ODL source files based on selected UML classes. The generated files provide a code-level representation of the modeled classes and their supported model information.
The exact generated declarations depend on the source model and the active generation templates. The resulting files can be reviewed, customized, and used as a starting point for subsequent development.
What Is Instant Code Generation?
Instant code generation is the process of generating source code from a model at a particular point in time. It provides a snapshot of the selected model elements in the target programming language.
Unlike round-trip engineering, Instant Generation does not establish an ongoing synchronization relationship between the generated source files and the UML model. If the model changes, users can run the generator again to produce updated output.
2. Understanding Object Definition Language (ODL)
ODL stands for Object Definition Language. It is a language associated with object database technology and the Object Data Management Group (ODMG) object model. It provides a way to describe object types and their structures, including attributes, relationships, and operations.
What Is ODL Used For?
ODL is used to define object-oriented data structures independently of a particular database implementation. It describes the types and relationships that make up an object database schema.
Typical modeling concepts associated with ODL include:
- Object types: Definitions of object categories and their structural characteristics.
- Attributes: Properties that describe the data held by an object.
- Relationships: Associations between object types.
- Operations: Operations or behaviors associated with object types.
- Inheritance: Hierarchical relationships between object types.
ODL and UML Class Diagrams
UML class diagrams and ODL both describe object-oriented structures, making UML class models a useful source for ODL generation.
A UML class diagram can represent classes, attributes, operations, inheritance, and associations. Visual Paradigm’s ODL Instant Generator uses selected UML classes as the basis for generating ODL source files.
This allows developers to begin with a visual model and move toward an object-oriented schema representation without manually recreating every modeled element in source code.
ODL Is Not SQL
ODL and SQL serve different purposes. ODL describes object-oriented data definitions, whereas SQL is primarily used to define, query, and manipulate relational database structures and data.
Generating ODL from UML should therefore not be confused with generating SQL DDL, relational database schemas, or database-specific table definitions. These are different code-generation targets.
3. Why Use the ODL Code Generator?
The ODL Instant Generator reduces the manual effort involved in translating UML class models into ODL source code. It also helps maintain consistency between the modeled object structure and its generated code representation.
Reduce Manual Coding Effort
Writing ODL declarations manually requires developers to inspect the UML model and translate its relevant elements into the target language. For models containing many classes, attributes, and relationships, this can become repetitive and time-consuming.
Automatic generation performs this translation through the configured generator templates, allowing developers to concentrate on reviewing and refining the resulting code.
Maintain Model-to-Code Consistency
Generating ODL directly from UML classes reduces the possibility of discrepancies caused by manually recreating model definitions. When the model is revised, developers can regenerate the output to reflect the updated design.
However, because Instant Generation is not round-trip synchronization, manual changes made to generated files should be managed carefully when regenerating code.
Support Model-Driven Development
The generator supports a model-driven workflow in which developers establish the object structure visually before producing implementation-oriented artifacts. This makes it easier to discuss, review, and refine a design before working with source code.
Improve Repeatability
Using the same model, generator configuration, and templates provides a repeatable approach to producing ODL source files. This is particularly useful when teams need to regenerate code after design revisions.
Reduce Potential Translation Errors
Manual translation can introduce inconsistencies, such as omitted properties, incorrectly reproduced names, or differences between modeled and implemented structures. Automated generation helps reduce these risks by using the UML model as the generation input.
Generated code should still be reviewed and validated against the intended ODL specification and the requirements of the target development environment.
4. Edition and Availability
ODL code generation is listed as a Visual Paradigm Desktop Code Engineering capability. According to the published Visual Paradigm edition comparison, ODL code generation is available in the Enterprise, Professional, and Standard editions.
| Visual Paradigm Desktop Edition | ODL Code Generation |
|---|---|
| Enterprise | Supported |
| Professional | Supported |
| Standard | Supported |
| Modeler | Not listed as supported |
| Community | Not listed as supported |
Edition entitlements and product packaging may change. Consult the official Visual Paradigm Edition Comparison for the latest availability information.
5. Prerequisites
Before generating ODL source code, prepare a Visual Paradigm Desktop project containing the UML class model you want to translate.
Required Model
- A Visual Paradigm Desktop project containing UML class diagrams or UML class model elements.
- One or more classes selected for code generation.
- Appropriate class names and model definitions.
- An output directory where generated ODL files can be stored.
Recommended Model Preparation
- Review class names and attributes for accuracy.
- Check inheritance and associations for consistency.
- Remove or exclude model elements that should not be included in the generated output.
- Ensure that the selected classes represent the intended object model.
- Save the project before beginning generation.
A well-organized UML class model makes the generation process easier to manage and the resulting ODL files easier to review.
6. Functionality Breakdown
The ODL Instant Generator provides several controls for selecting model elements, configuring generation behavior, managing output, and reviewing generated source code.
6.1 Language Selection
The Language setting specifies the target language for code generation. Select ODL to generate Object Definition Language source code.
This setting determines which generation templates and language-specific generation rules Visual Paradigm uses.
The Instant Generator supports multiple target languages. Selecting ODL is necessary when the intended output is ODL rather than Java, C++, Python, or another supported language.
6.2 Model Element Selection
The model element tree displays the packages and classes available for selection. Users must select classes to include in the generation process.
There are two ways to select classes:
- Diagrams tab: Select diagrams containing the classes you want to generate.
- Model Elements tab: Browse the project model and select individual classes directly.
This provides flexibility when working with either diagram-oriented or model-oriented project structures.
6.3 Diagram-Based Selection
The Diagrams tab allows users to select UML class diagrams as the basis for generation. Visual Paradigm then uses the classes contained in the selected diagrams as generation candidates.
This approach is useful when the intended output corresponds to a particular part of the system design or a specific class diagram.
6.4 Model-Element-Based Selection
The Model Elements tab provides direct access to the project’s packages and classes. Users can select the classes they want to generate without having to select entire diagrams.
This is useful when only a subset of the classes in a diagram or project needs to be generated.
6.5 Output Path
The Output Path specifies the destination directory for generated ODL source files.
Visual Paradigm writes the generated files to this directory when generation is executed. Users should choose an accessible directory with sufficient storage space and appropriate write permissions.
For better project organization, consider using a dedicated output directory for each generation target or development iteration.
6.6 Template Directory
The Template Directory specifies which code generation templates Visual Paradigm should use.
Visual Paradigm provides built-in templates for generating code. If users do not need customized output, they can leave the template directory unchanged and use the built-in templates.
Users who have prepared customized templates can specify their template directory to control how source files are generated.
Templates can be adapted for requirements such as adding organization-specific file headers or changing the formatting of generated code.
6.7 General Generation Options
The Instant Generator window exposes common configuration options. More detailed code-generation settings are available through the Advanced Options dialog.
These controls allow users to adjust the generation process without manually modifying every generated file.
6.8 Advanced Options
The Advanced Options dialog provides additional configuration for code generation.
The documented options include:
- Encoding: Specifies the character encoding used for generated source files.
- Allow From Linked Project: When enabled, allows generation to include classes in referenced projects.
6.9 Prompt to Confirm Overwrite File
This option controls how Visual Paradigm handles generated files that already exist in the output directory.
- Enabled: Visual Paradigm prompts users to confirm whether an existing file should be overwritten.
- Disabled: Existing generated files are overwritten automatically when generation produces files with matching names.
Keeping this option enabled is recommended when the output directory contains files that may have been manually edited or need to be preserved.
6.10 Output Pane
The Output pane displays information about the generation process, including progress messages, warnings, and errors.
Users can inspect this pane to determine whether generation has completed successfully and to identify problems that may need attention.
6.11 Preview
The Preview function allows users to inspect the generated code content before executing the actual generation process.
Previewing code does not generate files in the specified output directory. It is intended for reviewing the expected output without committing the generated files to disk.
This is useful for checking the generated content and identifying potential configuration or modeling issues before proceeding.
6.12 Generate
The Generate command starts the actual code-generation process. Visual Paradigm processes the selected classes using the chosen language, template directory, and generation settings, then writes the resulting source files to the specified output path.
6.13 Open Output Folder
The Open Output Folder command opens the specified output directory using the system’s file browser.
This allows users to inspect the generated files and access them for subsequent development activities.
6.14 Close
The Close command closes the Instant Generator window after users have finished configuring or executing code generation.
7. How to Generate ODL from UML in Visual Paradigm
Follow these steps to generate ODL source files from a UML class model using Visual Paradigm Desktop.
Step 1: Open Your Visual Paradigm Project
Launch Visual Paradigm Desktop and open the project containing the UML class diagrams or classes you want to generate.
Step 2: Open Instant Generator
From the main menu, select:
Tools > Code > Instant Generator
This opens the Instant Generator window, where you can configure the target language, model elements, output location, and other generation settings.
Step 3: Select ODL as the Target Language
In the Language selection field, choose ODL.
This tells Visual Paradigm to generate Object Definition Language source code rather than another supported programming or modeling language.
Step 4: Specify the Output Path
Enter or browse to the directory where you want Visual Paradigm to save the generated ODL files.
Make sure the destination directory is accessible and that you have permission to write files to it.
Step 5: Select the Classes to Generate
Choose the classes to include in the generation process.
You can select classes using either of the following methods:
- Open the Diagrams tab and select the diagrams containing the desired classes.
- Open the Model Elements tab and select individual classes from the project model.
Remember that selecting classes is required for code generation.
Step 6: Configure Generation Options
Review the available general options and adjust them as necessary.
If you need additional control, click Advanced Options to configure settings such as source-file encoding and whether classes from linked projects should also be generated.
Step 7: Review the Generated Code
Click Preview to inspect the generated code before writing the files to the output directory.
Use this opportunity to check whether the output reflects the selected model and whether the generated source content meets your expectations.
Step 8: Generate the ODL Files
Click Generate to start the generation process.
If a generated file already exists and overwrite confirmation is enabled, Visual Paradigm will ask whether the existing file should be overwritten.
Step 9: Review the Generation Results
Check the Output pane for progress information, warnings, or errors. Once generation has completed, click Open Output Folder to inspect the generated ODL files.
You can then review the source files and continue with your object-oriented development workflow.
8. Code Generation Options Explained
Correct configuration helps ensure that generated ODL files are stored in the intended location and use the appropriate generation settings.
Choosing the Correct Encoding
Encoding determines how characters are represented in the generated source files. Select an encoding compatible with your development environment and the characters used in your model.
Incorrect encoding choices can cause special characters or non-English text to display incorrectly when generated files are opened in other applications.
Generating Classes from Linked Projects
The Allow From Linked Project option controls whether the generator can also generate classes belonging to referenced projects.
This is relevant when the current project references another project containing model elements required by the generated output.
If linked-project classes are not needed, users can leave this option disabled.
Choosing an Overwrite Strategy
Overwrite confirmation is particularly important when regenerating code into a directory that already contains source files.
If the generated files are maintained as part of a development project, automatic overwriting can replace existing content. Review the output directory and preserve any important manual changes before regenerating.
Using Built-in or Customized Templates
Use the built-in templates for standard generation behavior. Specify a custom template directory when the output needs to follow particular formatting or organizational conventions.
Template customization is an advanced configuration activity and should be tested with representative UML models before being used in a production workflow.
9. Customizing ODL Generation Templates
Visual Paradigm supports customizable code generation templates. Templates determine how model information is transformed into source-code text and allow users to adapt generated files to particular project or organizational requirements.
Why Customize Generation Templates?
Different development teams may have different source-code conventions. For example, an organization may require specific file headers or formatting standards. Instead of manually applying these changes to every generated file, users can customize the generation templates.
Template Customization Workflow
- Locate the appropriate code generation template files supplied with Visual Paradigm.
- Copy the templates to a separate working directory so the original templates remain unchanged.
- Open the relevant template files in a text editor.
- Locate the sections responsible for generating the content you want to modify.
- Adjust the template logic or output formatting according to your requirements.
- Save the customized templates in your working directory.
- Open the Instant Generator in Visual Paradigm Desktop.
- Select ODL as the target language and specify your customized directory in the Template Directory field.
- Select the UML classes, specify the output path, and generate the code.
- Review the generated output to verify that the customized templates behave as intended.
What Can Be Customized?
Template customization can be used to control the structure and formatting of generated source code. Depending on the relevant template definitions, users can modify output text, formatting, and generated file content.
For example, custom templates may be used to add organization-specific headers or adjust how generated code is presented.
Important Template Considerations
- Keep an unchanged copy of the original templates.
- Use a separate directory for customized templates.
- Test changes against different model structures.
- Verify that the resulting files remain valid for the intended ODL environment.
- Remember that customized templates affect generation output and may need maintenance when the project or Visual Paradigm version changes.
For additional guidance, see How to Customize Code Generation Templates.
10. Generated Files and Output Management
Generated ODL source files are saved to the output directory configured in the Instant Generator window.
Where Are Generated ODL Files Saved?
The files are saved to the directory specified in the Output Path field. Visual Paradigm does not require users to use a particular project directory; the destination can be any accessible directory where the application has write permission.
Can Existing Files Be Replaced?
Yes. If generation produces a file with the same name as an existing file, Visual Paradigm uses the overwrite-confirmation setting to determine how the situation is handled.
With confirmation enabled, users are prompted to decide whether to overwrite the existing file. With confirmation disabled, the existing generated file is overwritten automatically.
How to Inspect Generated Files
After generation, use the Open Output Folder command to access the destination directory. You can then open the files using a suitable text editor or ODL development environment.
Managing Repeated Generations
When regenerating code after model changes, consider using a dedicated output directory and maintaining backups or version control for source files that contain manual modifications.
This helps prevent accidental loss of work when newly generated files replace existing ones.
11. Recommended Development Workflow
A practical ODL generation workflow begins with UML modeling, continues with code generation, and concludes with source-code review and validation.
Phase 1: Design the Object Model
- Create or open a UML class diagram in Visual Paradigm Desktop.
- Define the relevant classes and their attributes.
- Establish the necessary inheritance and associations.
- Review the model for completeness and consistency.
Phase 2: Generate ODL
- Open Tools > Code > Instant Generator.
- Select ODL as the target language.
- Choose the required diagrams or classes.
- Specify the output directory.
- Configure generation options and templates.
- Preview the output and generate the files.
Phase 3: Review and Validate
- Inspect the generated ODL source files.
- Check the generated definitions against the original UML model.
- Validate the ODL syntax using the intended development environment or compatible ODL tooling.
- Make any necessary implementation-specific refinements.
Phase 4: Update After Model Changes
- Revise the UML class model in Visual Paradigm.
- Run the Instant Generator again.
- Review the new output and overwrite prompts.
- Compare the generated files with the previous version.
- Validate the updated source files.
This workflow keeps the UML model as the design reference while allowing ODL source files to be regenerated whenever the modeled structure changes.
12. Capabilities and Limitations
Understanding the scope of the ODL Instant Generator helps users choose the right code engineering workflow.
What the ODL Generator Supports
- Generating ODL source code from UML class models.
- Selecting classes through UML diagrams.
- Selecting individual classes through the model element tree.
- Specifying an output directory.
- Using built-in or customized code generation templates.
- Configuring source-file encoding.
- Including classes from referenced projects through the linked-project option.
- Controlling overwrite confirmation for existing files.
- Previewing generated code before writing files.
- Reviewing generation progress, warnings, and errors.
What Should Not Be Assumed
- Automatic round-trip synchronization: ODL Instant Generation does not provide continuous synchronization between UML models and generated ODL files.
- Automatic database deployment: Generating ODL source files does not itself create or deploy an object database.
- SQL generation: ODL generation is not the same as generating SQL DDL or relational database scripts.
- Generation from every diagram type: Code generation is intended for supported model types, particularly UML class diagrams in this workflow. It should not be assumed that arbitrary diagrams can be translated into ODL.
- Production validation: Generated source code should be reviewed and validated for the intended ODL implementation environment.
- Preservation of manual changes: Regenerating files can overwrite existing source files, depending on the overwrite settings.
ODL Generation Versus Round-Trip Engineering
| Aspect | ODL Instant Generation | Round-Trip Engineering |
|---|---|---|
| Primary purpose | Generate source code from a model | Maintain synchronization between supported models and source code |
| Generation direction | UML model to ODL code | Depends on the supported round-trip workflow |
| Automatic synchronization | Not provided | Supported for specific languages and integrations |
| Regeneration after model changes | Run the generator again | Update through the round-trip workflow |
| ODL support | Supported | Do not assume ODL round-trip support |
13. Troubleshooting and Common Questions
ODL Is Not Available in the Language List
Check whether your Visual Paradigm Desktop edition includes ODL code generation. Consult the current edition comparison and verify your license activation and product version.
No Code Is Generated
Check that you have selected at least one UML class for generation. Selecting a diagram or opening the generator does not replace the requirement to select classes.
Also verify the output directory, file permissions, and messages displayed in the Output pane.
The Generated Files Are Not in the Expected Location
Check the Output Path field in the Instant Generator window. The generator saves files to the configured destination rather than automatically placing them in the project directory.
Existing Files Are Being Overwritten
Review the Prompt to Confirm Overwrite File setting. Enable it if you want Visual Paradigm to ask for confirmation before replacing existing generated files.
Generated Files Contain Incorrect Characters
Review the Encoding setting in Advanced Options and choose an encoding compatible with the content and the application used to open the files.
Classes from Referenced Projects Are Missing
Check whether Allow From Linked Project is enabled. This option allows the generator to include classes in referenced projects.
The Generated Code Does Not Reflect Recent Model Changes
Instant Generation produces output based on the model at the time the generation is performed. After changing the UML model, run the generator again to produce updated source files.
Manual Changes Disappear After Regeneration
Existing generated files may be overwritten during subsequent generation. Preserve manual changes using backups, version control, or a separate implementation layer rather than relying on generated files to retain modifications automatically.
Customized Templates Do Not Produce the Expected Output
Verify that the correct template directory is specified and that the customized templates are based on the appropriate original templates. Test the changes with a small representative UML model before generating a larger project.
Preview Does Not Create Files
This is expected behavior. Preview displays the generated code content without writing it to the output directory. Click Generate to create the actual source files.
14. Frequently Asked Questions (FAQ)
What is Visual Paradigm’s ODL Instant Code Generator?
Visual Paradigm’s ODL Instant Code Generator is a code engineering feature that generates Object Definition Language (ODL) source files from selected UML class models. It is accessed through Tools > Code > Instant Generator.
What does ODL stand for?
ODL stands for Object Definition Language. It is associated with object database modeling and provides definitions for object types and their structures.
Can Visual Paradigm generate ODL from UML class diagrams?
Yes. Visual Paradigm can generate ODL source code from UML class models. Users can select classes through the Diagrams tab or the Model Elements tab in the Instant Generator window.
How do I access the ODL generator?
In Visual Paradigm Desktop, select Tools > Code > Instant Generator. Choose ODL from the Language list, configure the output path, select the classes, and click Generate.
Can I generate ODL from individual UML classes?
Yes. Use the Model Elements tab to browse the project model and select the individual classes you want to generate.
Can I generate ODL from multiple class diagrams?
You can select diagrams in the Diagrams tab as the basis for class selection. The generator uses the classes in the selected diagrams for generation.
Do I have to select classes before generating ODL?
Yes. You must select classes for code generation. Merely opening the Instant Generator window or choosing ODL is not sufficient.
Where does Visual Paradigm save the generated ODL files?
Visual Paradigm saves generated files to the directory specified in the Output Path field of the Instant Generator window.
Can I preview ODL code before generating it?
Yes. Click Preview in the Instant Generator window to inspect the generated code content. Preview does not write files to the output directory. Use Generate to create the actual files.
Can I customize the generated ODL code?
Yes. Visual Paradigm supports customized code generation templates. Specify your customized template directory in the Instant Generator window to control the generated output according to your template definitions.
What is the Template Directory field used for?
The Template Directory field specifies the templates used to generate source code. Leave it unchanged to use Visual Paradigm’s built-in templates, or provide a custom template directory to use customized generation rules.
What does Allow From Linked Project do?
It allows the generator to generate classes that belong to referenced projects in addition to the classes selected in the current project.
What does the Encoding option do?
Encoding specifies the character encoding used for generated source files. It should be compatible with the text content and the tools that will open the generated files.
What happens if an ODL file already exists?
If a generated file already exists, Visual Paradigm can prompt users to confirm whether to overwrite it. If overwrite confirmation is disabled, the existing file is overwritten automatically.
Does Preview generate ODL files?
No. Preview only displays the generated code content. It does not create files in the output directory.
Does ODL Instant Generation support round-trip engineering?
No. ODL Instant Generation is a one-way model-to-code generation operation. It does not provide automatic synchronization between ODL source files and UML class models.
Can I update ODL files after modifying my UML class diagram?
Yes. Run the ODL Instant Generator again after modifying the UML model. Review the generated output and overwrite prompts before replacing existing files.
Does ODL generation create a database?
No. The generator produces ODL source files. Database creation, deployment, and execution require an appropriate object database environment and additional development or deployment steps.
Is ODL the same as SQL?
No. ODL describes object-oriented data definitions, while SQL is primarily associated with relational database systems. Generating ODL does not mean generating SQL DDL.
Can Visual Paradigm generate ODL from ER diagrams?
The documented ODL Instant Generator workflow uses UML class models as its input. It should not be assumed that ER diagrams can be directly selected as ODL generation sources.
Which Visual Paradigm editions support ODL generation?
The published edition comparison lists ODL code generation in Enterprise, Professional, and Standard editions. Modeler and Community editions are not listed as supporting this capability. Always consult the latest edition comparison for confirmation.
Can I generate ODL through the command line?
Visual Paradigm provides a command-line Instant Generator script that supports ODL as a target language. However, the command-line workflow generates only the classes selected during a previous generation operation in Visual Paradigm Desktop. Users must first perform at least one generation in the desktop application.
See the Instant Generator command-line guide for the supported parameters and setup instructions.
VISUAL PARADIGM