Previous Next
sde_java_user_guide Chapter 10 - Instant Generator

Chapter 10 - Instant Generator

In SDE for Eclipse, you can generate codes by using Instant Generator.

In this chapter:

What is Instant Generator?

The Instant Generator facility of SDE for Eclipse allows you to generate codes. SDE for Eclipse supports many types of language including Java, C#, VB.NET etc.This chapter provides a brief description on the supported formats and will show you how to generate codes.

Supported Sources

Instant Generator currently supports fifteen types of sources. They are:

We will use a SDE for Eclipse project as an example to illustrate the advanced options of different languages.

Figure 10.1 - Sample SDE for Eclipse project to illustrate the advanced options

Using Instant Generator

Open the Instant Generator dialog from the main menu: click Modeling > Instant Generator > Instant Generator... .

Figure 10.2 Open Instant Generator dialog

The Instant Generator dialog box will be displayed. 
Figure 10.3 Instant Generator dialog

General Settings

As the configuration is simplified, only three values are required to be input even if it is the first time running Instant Generator.

  1. Select Language to specify which language of source will generated for. In this example, C++ is selected.
    Figure 10.4 - Select Language


  2. Choose classes or packages which will be included in the generation.
    Figure 10.5 - Choose classes or packages included


  3. Select an output path for placing generated source.
    Figure 10.6 - Select output path

Language Specified Options

There are two options which allow you to control the properties in each language. One is Basic options and the other is Advanced options.
You can directly edit the common change options in Basic options in the Instant Generator dialog.
Figure 10.7 - Basic Options

Advanced options contains all options of the language,  including those in Basic options. To edit Advanced options, click Advanced Options in the Instant Generator dialog.
Figure 10.8 - Select Advanced Options
Figure 10.9 - Advanced Options

Preview or Generate

As different values of options will produce different generation results, the Instant Generator provides a preview of the generation result before the actual generation.

To Preview the generation result:

Press Preview in Instant Generator dialog.

Figure 10.10 - Select Preview

Previewing result:

Figure 10.11 - Previewing result

To generate codes using the Instant Generator dialog:
Press Generate in the Instant Generator dialog to perform actual generation.

Figure 10.12 - Select Generate

While the generation, the progress is displayed in Generator Output.
Output folder can be opened by pressing Open output folder in Instant Generator dialog.

Figure 10.13 - Open output folder

Generating Java

Using SDE for Eclipse, Java can be generated easily.

To generate Java:

1. Open the Instant Generator dialog for Java by clicking Modeling > Instant Generator > Java... in the main menu.

 Figure 10.14 - Open Instant Generator dialog for Java

2. The Instant Generator dialog box for Java is displayed.

Figure 10.15 - Instant Generator dialog box

3. Choose the classes or packages you want to generate in Java.

 Figure 10.16 - Choose the classes and packages

4. Edit the Options.

 Figure 10.17 - Edit the options


Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Generate Ant build file Check this option to generate Ant build file.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Association implementation Select from drop-down menu any of the options to configure the multiplicity of a class:
Vector - The collection is expandable size.
Array - The collection has fixed size.
JDK Version
Select this option to generate code for target JDK. The version SDE for Eclipse supports are 5.0 and 1.4.
Advanced Options... Edit the advance options.

Table 10.1

Figure 10.18 - Example illustrating the functions of different options in Advanced Options



Figure 10.19 - Diagram of invalid char

4. Specify the Output path and select Generate to generate Java.

Figure 10.20 - Select Generate


5.The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.21 - Open output folder

6. Java files are generated.
Figure 10.22 - Java files generated

Generating C#

SDE for Eclipse can generate C# file.
To generate C#:

1. Open Instant Generator dialog for C# by clicking Modeling > Instant Generator > C#... in the main menu.

 Figure 10.23 - Open Instant Generator dialog for C#

2. The Instant Generator dialog box for C# is displayed.

 Figure 10.24 - Instant Generator dialog box

3. Choose the classes or packages you want to generate C#.

 Figure 10.25 - Choose the classes and packages

4. Edit the Options.

 Figure 10.26 - Edit the options


Name Description
Create folder for namespace Create a new folder for namespace to avoid name conflict.
Implements abstract method Check this option to implement abstract methods in generated classes.
Follow Microsoft naming convention Name the file generated using the Microsoft naming convention. If you uncheck this option, you can enter the prefix for attribute and parameter of prefix.
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Advanced Options...
Edit the advance options.

Table 10.2

Figure 10.27 - Example illustrating the functions of different options in Advanced Options



Figure 10.28 - Diagram of invalid char

Figure 10.29 - File generated with folder created for namespace

5. Specify the Output path and select Generate to generate C#.
Figure 10.30 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.31 - Open output folder

7.C# files generated.
Figure 10.32 - C# files generated

Generating VB.NET

SDE for Eclipse can generate VB.NET file.
To generate VB.NET file:

1. Open the Instant Generator dialog for VB.NET by clicking Modeling > Instant Generator > VB.NET... in the main menu.

 Figure 10.33 - Open Instant Generator dialog for VB.NET

2. The Instant Generator dialog box for VB.NET is displayed.

 Figure 10.34 Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.35 - Choose the classes and packages

4. Edit the Options.

 Figure 10.36 - Edit the options


Name Description
Create folder for namespace Create a new folder for namespace to avoid name conflict.
Implements abstract method Check this option to implement abstract methods in generated classes.
Follow Microsoft naming convention Name the file generated using the Microsoft naming convention. If you uncheck this option, you can enter the prefix for attribute and parameter of prefix.
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Advanced Options...
Edit the advance options.

Table 10.3

Figure 10.37 - Example illustrating the functions of different options in Advanced Options
Figure 10.38 - File generated with folder created for namespace

5. Specify the Output path and select Generate to generate VB.NET.
Figure 10.39 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.40 - Open output folder

7.VB.NET files generated.
Figure 10.41 - VB.NET files generated

Generating PHP

SDE for Eclipse can generate PHP file.
To generate PHP file:

1. Open the Instant Generator dialog for PHP by clicking Modeling > Instant Generator > PHP... in the main menu.

 Figure 10.42 - Open Instant Generator dialog for PHP

2. The Instant Generator dialog box for PHP is displayed.

 Figure 10.43 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.44 - Choose the classes and packages

4. Edit the Options.

 Figure 10.45 - Edit the options

Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Directory Select from drop-down menu any of the options to configure the output directory:
Flat level: Save files to the output path defined below.
Follow package: Create a new directory with the package names in the output path and save files there.
Advanced Options...
Edit the advance options.

Table 10.4

Figure 10.46 - Example illustrating the functions of different options in Advanced Options



Figure 10.47 - Diagram of invalid char
 
5. Specify the Output path and select Generate to generate PHP.
Figure 10.48 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.49 - Open output folder

7.PHP files generated.
Figure 10.50 - PHP files generated

Generating ODL

SDE for Eclipse can generate ODL file.
To generate ODL file:

1. Open the Instant Generator dialog for ODL by clicking Modeling > Instant Generator > ODL... in the main menu.

 Figure 10.51 - Open Instant Generator dialog for ODL

2. Instant Generator dialog box for ODL is displayed.

 Figure 10.52 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.53 - Choose the classes and packages
 
4. Specify the Output path and select Generate to generate ODL.
Figure 10.54 - Select Generate


5. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.55 - Open output folder

6.ODL files generated.
Figure 10.56 - ODL files generated

Generating ActionScript

SDE for Eclipse can generate ActionScript file.
To generate ActionScript file:

1. Open the Instant Generator dialog for ActionScript by clicking Modeling > Instant Generator > ActionScript... in the main menu.

 Figure 10.57 - Open Instant Generator dialog for ActionScript

2. The Instant Generator dialog box for ActionScript is displayed.

 Figure 10.58 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.59 - Choose the classes and packages

4. Edit the Options.

 Figure 10.60 - Edit the options


Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Advanced Options...
Edit the advance options.

Table 10.5

Figure 10.61 - Example illustrating the functions of different options in Advanced Options



Figure 10.62 - Diagram of invalid char


5. Specify the Output path and select Generate to generate ActionScript.
Figure 10.63 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.64 - Open output folder

7.ActionScript files generated.

Figure 10.56 - ActionScript files generated


Generating IDL

SDE for Eclipse can generate IDL file.
To generate IDL file:

1. Open the Instant Generator dialog for IDL by clicking Modeling > Instant Generator > IDL... in the main menu.

 Figure 10.66 - Open Instant Generator dialog for IDL

2. The Instant Generator dialog box for IDL is displayed.

 Figure 10.67 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.68 - Choose the classes and packages

4. Edit the Options.

 Figure 10.69 - Edit the options


Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Advanced Options...
Edit the advance options.

Table 10.6

 Figure 10.70 - Example illustrating the functions of different options in Advanced Options

5. Specify the Output path and select Generate to generate ActionScript.
Figure 10.71 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.72 - Open output folder

7.IDL files generated.

Figure 10.73 - IDL files generated



Generating C++

SDE for Eclipse can generate C++ file.
To generate C++ file:

1. Open the Instant Generator dialog for IDL by clicking Modeling > Instant Generator > C++... in the main menu.

 Figure 10.74 - Open Instant Generator dialog for C++

2.The Instant Generator dialog box for C++ is displayed.

 Figure 10.75 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.76 - Choose the classes and packages

4. Edit the Options.

 Figure 10.77 - Edit the options


Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Association implementation Select from drop-down menu any of the options to configure the multiplicity of a class:
Vector - The collection is expandable size.
Array - The collection has fixed size.
Advanced Options...
Edit the advance options.

Table 10.7

 Figure 10.78 - Example illustrating the functions of different options in Advanced Options



Figure 10.79 - Diagram of invalid char


5. Specify the Output path and select Generate to generate C++.
Figure 10.80 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.81 - Open output folder

7.C++ files generated.

Figure 10.82 - C++ files generated


Generating Delphi

SDE for Eclipse can generate Delphi file.
To generate Delphi file:

1. Open the Instant Generator dialog for Delphi by clicking Modeling > Instant Generator > Delphi... in the main menu.

 Figure 10.38 - Open Instant Generator dialog for Delphi

2. The Instant Generator dialog box for Delphi is displayed.

 Figure 10.84 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.85 - Choose the classes and packages

4. Edit the Options.

 Figure 10.86 - Edit the options


Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Advanced Options...
Edit the advance options.

Table 10.8

 Figure 10.87 - Example illustrating the functions of different options in Advanced Options

5. Specify the Output path and select Generate to generate Delphi.
Figure 10.88 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.89 - Open output folder

7.Delphi files generated.

Figure 10.90 - Delphi files generated




Generating Perl

SDE for Eclipse can generate Perl file.
To generate Perl file:

1. Open the Instant Generator dialog for Delphi by clicking Modeling > Instant Generator > Perl... in the main menu.

 Figure 10.91 - Open Instant Generator dialog for Perl

2.The Instant Generator dialog box for Perl is displayed.

 Figure 9.92 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.93 - Choose the classes and packages

4. Edit the Options.

 Figure 10.94 - Edit the options


Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Advanced Options...
Edit the advance options.

Table 10.9

Figure 10.95 - Example illustrating the functions of different options in Advanced Options



Figure 10.96 - Diagram of invalid char


5. Specify the Output path and select Generate to generate Perl.
Figure 10.97 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.98 - Open output folder

7.Perl files generated.

Figure 10.99 - Perl files generated



Generating XSD

SDE for Eclipse can generate XSD file.
To generate XSD file:

1. Open the  Instant Generator dialog for XSD by clicking Modeling > Instant Generator > XSD... in the main menu.

 Figure 10.100 - Open Instant Generator dialog for XSD

2 The. Instant Generator dialog box for XSD is displayed.

 Figure 10.101 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.102 - Choose the classes and packages

4. Edit the Options.

 Figure 10.103 - Edit the options


Name Description
Indentation To configure the spacing characters you want to use for each indent level.
A tab button is provided to add tab to define different levels.
Generate unnamed attribute
To allow generating unnamed attribute.
Unnamed attribute
Predefine a name for unnamed attribute.
Invalid char replacement
If there is character which is invalid, the character will be replaced by the character type in the text box.
Default attribute type
Configure the default type of attribute.
Advanced Options...
Edit the advance options.

Table 10.10

Figure 10.104 - Example illustrating the functions of different options in Advanced Options

Figure 10.105 - Diagram of invalid char


5. Specify the Output path. Then, select Generate to generate XSD.
Figure 10.106 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.107 - Open output folder

7.XSD files generated.

Figure 10.108 - XSD files generated



Generating Python

SDE for Eclipse can generate Python file.
To generate Python file:

1. Open Instant Generator dialog for Python by clicking Modeling > Instant Generator > Python... in the main menu.

 Figure 10.109 - Open Instant Generator dialog for Python

2. Instant Generator dialog box for Python is displayed.

 Figure 10.110 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.111 - Choose the classes and packages

4. Edit the Options.

 Figure 10.112 - Edit the options


Name Description
Attribute prefix
To configure the prefix of attribute.
Parameter prefix
To configure the prefix of parameter.
Generate association operations
If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Advanced Options...
Edit the advance options.

Table 10.11

Figure 10.113 - Example illustrating the functions of different options in Advanced Options



Figure 10.114 - Diagram of invalid char


5. Specify the Output path and select Generate to generate Python.
Figure 10.115 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation is complete, you can select Open output folder to open the files in the generated folder.

Figure 10.116 - Open output folder

7. Python files generated.

Figure 10.117 - Python files generated





Generating Objective-C

SDE for Eclipse can also generate Objective-C files.
To generate an Objective-C file:

1. Open the Instant Generator dialog for Objective-C by clicking Modeling > Instant Generator > Objective-C... in the main menu.

 Figure 10.118 - Open Instant Generator dialog for Objective-C

2. Instant Generator dialog box for Objective-C is displayed.

 Figure 10.119 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.120 - Choose the classes and packages

4. Edit the Options.

 Figure 10.121 - Edit the options

Name Description
Attribute prefix
To configure the prefix of attribute.
Parameter prefix
To configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations
If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Advanced Options...
Edit the advance options.

Table 10.12
Figure 10.122- Example illustrating the functions of different options in Advanced Options



Figure 10.123- Diagram of invalid char


5. Specify the Output path. Then, select Generate to generate Objective-C.
Figure 10.124 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the newly generated folder.

Figure 10.125 - Open output folder

7. Objective-C files generated.

Figure 10.126 - Objective-C files generated




Generating Ada95

SDE for Eclipse can also generate Ada95 file.
To generate an Ada95 file:

1. Open the Instant Generator dialog for Ada95 by clicking Modeling > Instant Generator > Ada95... in the main menu.

 Figure 10.127 - Open Instant Generator dialog for Ada95

2. The Instant Generator dialog box for Ada9x is displayed.

 Figure 10.128 - Instant Generator dialog box

3. Choose the classes or packages you want to generate.

 Figure 10.129 - Choose the classes and packages

4. Edit the Options.

 Figure 10.130- Edit the options

Name Description
Attribute prefix
To configure the prefix of attribute.
Parameter prefix
To configure the prefix of parameter.
Generate this parameter Check to generate this parameter.
This Parameter Name Configure the name of this parameter.
Advanced Options...
Edit the advance options.

Table 10.13

Figure 10.131 - Example illustrating the functions of different options in Advanced Options

5. Specify the Output path and click Generate to generate Ada95.
Figure 10.132 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.133 - Open output folder

7. Ada95 files generated.
Figure 10.134 - Ada95 files generated

Generating Ruby

SDE for Eclipse can generate Ruby files.
To generate a Ruby file:

1. Open Instant Generator dialog for Ruby by clicking Modeling > Instant Generator > Ruby... in the main menu.

 Figure 10.135 - Open Instant Generator dialog for Ada9x

2. Instant Generator dialog box for Ada95 is displayed.

 Figure 10.136 - Instant Generator dialog box

3. Choose the classes or packages you want to generate .

 Figure 10.137 - Choose the classes and packages

4. Edit the Options.

 Figure 10.138 - Edit the options

Name Description
Attribute prefix Configure the prefix of attribute.
Parameter prefix Configure the prefix of parameter.
Implements abstract operations Check this option to implement abstract operations in generated classes.
Generate association operations If you check this box, when a role is selected to provide setter/getter, the corresponding operation(s) will be generated for the role's attribute.
Advanced Options...
Edit the advance options.

Table 10.14
Figure 10.139 - Example illustrating the functions of different options in Advanced Options



Figure 10.140 - Diagram of invalid char


5. Specify the Output path. Then, select Generate to generate Ada95.
Figure 10.141 - Select Generate


6. The progress of generation is shown in the Generator Output column. After generation, you can select Open output folder to open the output folder generated.

Figure 10.142 - Open output folder

7. Ruby files generated.
Figure 10.143 - Ruby files generated

Previous Next
Visual Paradigm International Limited
Website: www.visual-paradigm.com
E-mail: support@visual-paradigm.com