Code Generation - Turn Your Diagram to Code

Transform UML to code. Our code generator allows you to convert your diagrams to source code in various programming languages. Mostly, you will need to build codes and scripts for UML class diagrams or entity-relationship diagrams. However, you can also generate code from a UML state machine diagram or any other diagram type with custom-defined templates.

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
  • C++
  • C#
  • Delphi
  • Java
  • JavaSCript
  • PHP
  • Protocol Buffer
  • Python
  • Ruby
  • SQL DDL
  • TypeScript
  • VB6
  • VB.NET
  • XSD
Diagram Editor with Code Generation Sidebar
Diagram Editor with Code Generation Sidebar

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.

Source Code Generation Dialog
Working with Source Code Generation dialog

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.

New Comment

Comment