Author:
Johannes Schröpfer
Affiliation:
Chair of Applied Computer Science I, University of Bayreuth, 95440 Bayreuth, Germany
Keyword(s):
Model-Driven Development, Projectional Editing, SOIL, Ecore, OCL, Code Generation.
Abstract:
Model-driven software engineering often deals with combinations of structural and behavioral models. In this area, class models are common artifacts expressing the structure of software systems. From class models, source code can be generated which captures the structural elements. To be runnable, the generated code usually has to be completed by implementing behavior. The Eclipse Modeling Framework (EMF) is a popular environment for model-driven software development. In this context, class models are specified as instances of the Ecore metamodel. From Ecore models, Java code is generated that lacks in the implementation of method bodies (typically, only method heads are generated). Our approach supports code generation from extended metamodels comprising structural elements, behavior, and constraints. To this end, we build a projectional editor for a textual modeling language based on SOIL, an imperative extension of OCL. The editor allows for specifying extended class models from w
hich Java code can be generated. Our goal is to reuse the standard EMF code generator. The resulting Java source code is fully executable such that after creating the extended class model, no user interaction is required any more. In this paper, we present the idea of our approach and the current state of implementation.
(More)