Generation mechanisms in graphical template language Elina Kalnina * , Audris Kalnins, Edgars Celms, Agris Sostaks * , Janis Iraids * University of Latvia, IMCS, Raina bulvaris 29, LV-1459 Riga, Latvia Elina.Kalnina@lumii.lv, Audris.Kalnins@lumii.lv, Edgars.Celms@lumii.lv, Agris.Sostaks@lumii.lv, Janis Iraids@lumii.lv Abstract. Textual models in MDD typically are generated in their concrete syntax using a template based language. On the contrary, graphical models as a rule are generated in abstract syntax and then visualized, which is not very efficient for complicated languages. The paper discusses a case of template based generation of graphical models in a concrete syntax. We apply this approach to generation of programs in MOLA transformation language using the Template MOLA language. A novel idea of merge mechanism in MOLA templates is proposed which permits to obtain the required structure of generated models in an easy way. 1 Introduction Model driven development (MDD) has become one of the most popular technologies for software development, with model transformations as the key support feature. MDD can be naturally applied also to transformation development itself. This means that transformations are used to create transformations. Typically such transformations are called Higher-Order Transformations (HOT). In this paper we want to discuss just this aspect of MDD and template based languages for it. There are many template based model to text languages, for example, JET [1], mof2text [2], and other. The basic application of these languages is to create code (in Java, XML, etc.) from the PSM model in the standard MDD process. These languages typically contain facilities to navigate the given model according to its metamodel. However, the main advantage of these languages is the possibility to define the text fragment to be generated by the given rule as a textual template in the relevant concrete syntax. Graphical languages are also used in software development. There are cases when we want to generate code (in fact, diagrams) for these graphical languages. Code generation for graphical languages is significantly less examined. The universal approach would be to create code in graphical languages using abstract syntax of the language and then generate some kind of visualisation. This approach works well in simple cases e.g., when one type of UML diagrams is to be generated from another. However, for more sophisticated languages such as transformation languages this * Research is partially supported by ESF projects 2009/0138/1DP/1.1.2.1.2/09/IPIA/VIAA/004 and 2009/0162/1DP/1.1.2.1.1/09/IPIA/VIAA/004