# Generating model, edit and editor code

Since Ecore-based models such as the ESDL model contain semantics, source code can be generated from this model. EMF allows you to create three different types of source code:

* ESDL Model code - creates Java-classes out of the model, including the ECore semantics (they inherit from the`EObject-`class)
* ESDL Edit code - creates editor-independent code to manipulate and edit the ESDL model instances.
* ESDL Editor code - creates the Tree-based editor described [here](https://energytransition.gitbook.io/esdl/how-to-use-esdl/using-esdl-to-model-an-energy-system/esdl-tree-editor) to edit ESDL model instances.

## Using the `.genmodel`

Code generation is specified in the `esdl.genmodel` file. In Eclipse you can open this file in its own editor. In the properties there are a lot of options you can configure to change the code generation behaviour.&#x20;

When right-clicking on the esdl-package you can select Generate... to generate one or more of the above mentioned artefacts, or press Ctrl+Shift+G to pop-up the Generator dialog.

![](https://2468807995-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEUR-fboF2eOWi4I9zf%2F-LM29xBNSCK4ay5Niwhg%2F-LM2CIDf7Qdr_RBXFM3Z%2FGenerate.png?alt=media\&token=481071b7-4df8-43f6-9a93-081155767ccf)

The current `esdl.genmodel` is configured to produce an XML Schema too, that can be used by other non-Java-based software. The next chapters shows how to integrate with e.g. Python.
