Code Generation - Turn Your Diagram to Code
Software Ideas Modeler allows you to generate code in various programming and scripting languages. UML code generator supports the following programming languages with the pre-defined generation templates:
- Action Script
- Protocol Buffer
- SQL DDL
UML to Code
Software Ideas Modeler can generate code from UML diagrams. There are pre-defined templates that allow you to turn your UML Class Diagram with all the classes, interfaces, enumerations, and various relationships to source code in Java, C#, Python, C++, or other languages.
You can specify logical (UML) types for the attributes and operation and the generator will transform them into a correct type in the target language. If there is a need for language-specific types that cannot be resolved from the general logic types, you can use a type set for the specific language directly in the diagram - then the exact type will be used.
How to Generate Code for a Diagram?
There are two ways how to generate source code for a diagram - using the Generation sidebar or the Generation dialog.
The fastest way is to use the Generation sidebar. (It can be displayed from Ribbon/View tab/Window group/Sidebars drop-down/Generation). The sidebar allows you to generate code for the active diagram or only for the selected elements in the diagram editor. So you can easily generate code snippets and copy them from the code editor inside the sidebar.
How to Generate Code for Multiple Diagrams or Whole Project?
You can also generate the source code from UML using the Source Code Generation dialog. It is useful when you want to generate code for the whole project or more diagram at once. You can open it from the ribbon - Process tab / Generation group / Source Code button.
You can choose which diagrams you want to generate in the Source Code Generation dialog. The dialog supports searching in the project tree and offers the button for multiple node selection.
Unsupported Language or Diagram to Code Transformation
If you need to transform the diagram into code for a specific programming language or a framework in a defined language, you can do it. Software Ideas Modeler provides source code template language which allows you to define any template for any diagram type you want. You may even add a new programming language.