|
In SDE for Eclipse, you can generate codes by using 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.
Instant Generator currently supports fifteen types of sources. They are:
![]() |
| Figure 10.1 - Sample SDE for Eclipse project to illustrate the advanced options |
Open the Instant Generator dialog from the main menu: click Modeling > Instant Generator > Instant Generator... .
![]() |
| Figure 10.2 Open Instant Generator dialog |
![]() |
| Figure 10.3 Instant Generator dialog |
As the configuration is simplified, only three values are required to be input even if it is the first time running Instant Generator.
![]() |
| Figure 10.4 - Select Language |
![]() |
| Figure 10.5 - Choose classes or packages included |
![]() |
|
Figure 10.6 - Select output path
|
![]() |
| Figure 10.7 - Basic Options |
![]() |
|
Figure 10.8 - Select Advanced Options
|
![]() |
|
Figure 10.9 - Advanced Options
|
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
|
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. |
![]() |
| 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
|
![]() |
|
Figure 10.22 - Java files generated
|
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. |
![]() |
| 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 |
![]() |
| 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
|
![]() |
|
Figure 10.32 - C# files generated
|
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. |
![]() |
| Figure 10.37 - Example illustrating the functions of different options in Advanced Options |
![]() |
|
Figure 10.38 - File generated with folder created for namespace
|
![]() |
| 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
|
![]() |
|
Figure 10.41 - VB.NET files generated
|
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 |
![]() |
| Figure 10.43 - Instant Generator dialog box |
![]() |
| Figure 10.44 - Choose the classes and packages |
![]() |
| 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. |
![]() |
| Figure 10.46 - Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.47 - Diagram of invalid char |
![]() |
| 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
|
![]() |
|
Figure 10.50 - PHP files generated
|
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 |
![]() |
| 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
|
![]() |
|
Figure 10.56 - ODL files generated
|
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. |
![]() |
| Figure 10.61 - Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.62 - Diagram of invalid char |
![]() |
| 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
|
![]() |
| Figure 10.56 - ActionScript files generated |
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. |
![]() |
| Figure 10.70 - Example illustrating the functions of different options in Advanced Options |
![]() |
| 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
|
![]() |
| Figure 10.73 - IDL files generated |
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. |
![]() |
| Figure 10.78 - Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.79 - Diagram of invalid char |
![]() |
| 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
|
![]() |
| Figure 10.82 - C++ files generated |
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. |
![]() |
| Figure 10.87 - Example illustrating the functions of different options in Advanced Options |
![]() |
| 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
|
![]() |
| Figure 10.90 - Delphi files generated |
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. |
![]() |
| Figure 10.95 - Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.96 - Diagram of invalid char |
![]() |
| 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
|
![]() |
| Figure 10.99 - Perl files generated |
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. |
![]() |
| Figure 10.104 - Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.105 - Diagram of invalid char |
![]() |
| 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
|
![]() |
| Figure 10.108 - XSD files generated |
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. |
![]() |
| Figure 10.113 - Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.114 - Diagram of invalid char |
![]() |
| 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
|
![]() |
| Figure 10.117 - Python files generated |
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. |
![]() |
| Figure 10.122- Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.123- Diagram of invalid char |
![]() |
| 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
|
![]() |
| Figure 10.126 - Objective-C files generated |
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. |
![]() |
| Figure 10.131 - Example illustrating the functions of different options in Advanced Options |
![]() |
| 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
|
![]() |
| Figure 10.134 - Ada95 files generated |
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. |
![]() |
| Figure 10.139 - Example illustrating the functions of different options in Advanced Options |
![]() |
| Figure 10.140 - Diagram of invalid char |
![]() |
| 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
|
![]() |
| Figure 10.143 - Ruby files generated |
|
|
|||||||