Many model-driven development (MDD) tools employ specialized frameworks and modeling languages, and assume that the semantics of models is provided by some form of code generation. As a result, programming against models is cumbersome and does not integrate well with ordinary programming languages and IDEs. In this paper we present MD4J, a modeling approach for embedding metamodels directly in Java, using plain interfaces and annotations. The semantics is provided by data managers that create and manipulate models. This architecture enables two kinds of extensibility. First, the data managers can be changed or extended to obtain different base semantics of a model. This allows a kind of aspect-oriented programming. Second, the metamodels themselves can be extended with additional fields and methods to modularly enrich a modeling language. We illustrate our approach using the example of state machines, discuss the implementation, and evaluate it with two case-studies: The execution of UML activity diagrams and an aspect-oriented refactoring of JHotDraw.

, , ,
doi.org/10.1145/2993236.2993240
ACM SIGPLAN Notices
ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
Centrum Wiskunde & Informatica, Amsterdam (CWI), The Netherlands

Zacharopoulos, T., Inostroza Valdera, P., & van der Storm, T. (2016). Extensible modeling with managed data in Java. In GPCE 2016 - Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, co-located with SPLASH 2016 (Vol. 52, pp. 25–35). doi:10.1145/2993236.2993240