A flexible code generator for MOF-based modeling languages

The Meta Object Facility (MOF) is the core component of OMGt’s ModelDriven Architecture (MDA). MOF defines the metamodeling language, which is used to define the languages which are used to model apllications, such as the Unified Modeling Language (UML). The importance of MOF will grow in the future, because more and more domain-specific modeling languages will be defined as extensions to or adaptations of the UML instead of being proprietary. To be really useful for software development, modeling languages need to be accompanied by tools. In this paper we present MOmoC, which is a model compiler based on the Extensible Stylesheet Language Transformations (XSLT) standard. MOmoC generates implementation code from XMI representations of MOF-metamodels. The compiler frontend mainly consists of generated code and creates an object representation from the XMI input file. This object representation is transformed into an internal XML representation, which is easier to process by XSLT than the input format XMI. The compiler backend generates implementation code by applying XSLT stylesheets to the internal XML representation of the MOF model. This architecture facilitates the adaptation of the generated code to specific purposes as well as the adaptation of the compiler to other MOF-based modeling languages. Therefore, we think that MOmoC can serve as a basis for automating the model transformations within MDA-based processes.