Quick Tutorial
Follow these steps to try two basic samples in less than 5 minutes.
Sample 1. Hello world
- Open the project: HelloWord
- From the menu select: File > Open
- Select Folder: 010 HelloWorld
- Select project file: HelloWorld.essprj
- Open the file: Meta
Meta.meta contains a basic metamodel defining MailMessage and Person types with basic properties.
Try adding a new property like int? Age to the Person type. Note that you can use code completion
pressing Control-Space.
When finished, press Control-S to save.
-
Open the file: Model
Model.ess contains a sample model with a MailMessage and some Persons.
Try to add and Age property to any person.
Note: You can use code completion again (Control-Space) to check for missing properties.
- Open the file: Template
Take a look on the templates defined.
This templates will dump the model to a text form and to an HTML form.
- Open the file: Transf
This file controls the transformation, selecting the model, applying templates and resolving output files.
- Validate the project
To check that everything is correct in the model, click on the Validate All button.
If any error is pressent a double-click on an error will jump to the issue.
- Finally: Generate some code!
- In the project tree (on the left) select the file: Transf.ctl.
- Open the contextual menu with the secondary button of the mouse.
- Select Apply Transformation
Model to Text transformations (M2T) are implemented in Essential applying StringTemplate templates.
- Review the output
- In the project tree (on the left) select the folder: Output
- Open the contextual menu with the secondary button of the mouse.
- Select Explore Output Directory and review the results.
Sample 2. Persistence
- Open the project: Persistence
- From the menu select: File > Open
- Select Folder: 010 Persistence
- Select project file: Persistence.essprj
- Review the project
The organization is quite similar to the previous sample but more models and metamodels are present.
- Review the file: Main.ctl
Review the order of transformations applied.
- Open the file: DeriveDBSchem.mtrx
This file describes a basic Model to Model (M2M) declarative transformation
to translate classes to tables.
There are more samples to explore. Go on yout own and enjoy!
More info at: http://pjmolina.com/essential