Architect Mode

What is it ?


With the Architect mode, Mia-Generation provides you with a complete graphical environement to define your own code generation rules or adapt existing ones

 

 

 

Structure of a generation project


A generator is defined within a project.


Scripts (templates or Java macros) are defined within packages to augment modularity and facilitate reuse of generation rules between generators.


Any complex generation can be defined through a Scenario.

 

 

Templates


The generation engine is based on the templating mechanism.

  • In black : the text generated "as is".
  • In green : variable parts replaced at generation time depending on the evaluation of a model element.

 

 

 

Code completion


Available scripts are accessible through code completion

 

 

 

Hand-coded fragments preservation


Tags definition.


Each template can define tags (BeginTag and EndTag) to delimit hand-coded fragments.


Mia-generation will preserve the code between those tags each time the file is regenerated.

 

 

 

Java macros


Generation rules which can't be defined with a template (string manipulation, navigation in the model, etc...) can be written directly in Java.


Mia-Generation provides syntax highlighting and code completion on Java macros too.

 

 

 

Breakpoints


It is possible to set a breakpoint on a script and define the elements of the model for which the generation has to be stopped.

 

 

 

Cross references


You can navigate through references between scripts :

  • Who is calling me
  • Which scripts do I call ?
  • Where the called scripts are defined ?
  • etc...

 

 

 

Model browser


It is very easy to navigate through the model and visualize links between model elements and each basic property

 

 

Generation trace


To understand the way a generation is processed, a graphical trace shows each step :

  • Source of the script executed
  • Object on which the script has been evaluated
  • The generated code fragment

From the trace, you can access directly to the script editor or to the model browser.