Feature-Based Survey of Model Transformation Approaches
Total Page:16
File Type:pdf, Size:1020Kb
Feature-based survey of model transformation approaches & Model transformations are touted to play a key role in Model Driven Developmente. Although well-established standards for creating metamodels such as the Meta-Object Facility exist, there is currently no mature foundation for specifying transformations K. Czarnecki among models. We propose a framework for the classification of several existing and S. Helsen proposed model transformation approaches. The classification framework is given as a feature model that makes explicit the different design choices for model transforma- tions. Based on our analysis of model transformation approaches, we propose a few major categories in which most approaches fit. 9,10 INTRODUCTION Creating query-based views of a system Model-driven software development is centered on Model evolution tasks such as model refactor- 1 11,12 the use of models. Models are system abstractions ing that allow developers and other stakeholders to Reverse engineering of higher-level models from 13 effectively address concerns, such as answering a lower-level models or code. question about the system or effecting a change. Examples of model-driven approaches are Model Considerable interest in model transformations has 2,3 Driven Architecture** (MDA**), Model-Inte- been generated by the standardization effort of the 4 5 Object Management Group, Inc. (OMG**). In April grated Computing (MIC), and Software Factories. 2002, the OMG issued a Request for Proposal (RFP) Software Factories, with their focus on automating 14 on Query/Views/Transformations (QVT), which product development in a product-line context, can led to the release of the final adopted QVT also be viewed as an instance of generative software 15 6 specification in November 2005. Driven by prac- development. tical needs and the OMG’s request, a large number Model transformations are touted to play a key role of approaches to model transformation have been in Model Driven Development** (MDD**). Their proposed over the last three years. However, as of intended applications include the following: ÓCopyright 2006 by International Business Machines Corporation. Copying in Generating lower-level models, and eventually printed form for private use is permitted without payment of royalty provided 7 that (1) each reproduction is done without alteration and (2) the Journal code, from higher-level models reference and IBM copyright notice are included on the first page. The title and abstract, but no other portions, of this paper may be copied or distributed Mapping and synchronizing among models at the royalty free without further permission by computer-based and other 8 information-service systems. Permission to republish any other portion of the same level or different levels of abstraction paper must be obtained from the Editor. 0018-8670/06/$5.00 Ó 2006 IBM IBM SYSTEMS JOURNAL, VOL 45, NO 3, 2006 CZARNECKI AND HELSEN 621 this writing, industrial-strength and mature model- WHAT IS MODEL TRANSFORMATION? to-model transformation systems are still not avail- Transformation is a fundamental theme in computer able, and the area of model transformation contin- science and software engineering. After all, compu- ues to be a subject of intense research. In this paper, tation can be viewed as data transformation. we propose a feature model to compare different Computing with basic data such as numeric values model transformation approaches and offer a survey and with data structures such as lists and trees is at and categorization of a number of existing ap- the heart of programming. Type systems in pro- proaches from four sources: gramming languages help ensure that operations are applied compatibly to the data. However, when the 1. Published in the literature—VIATRA (VIsual subject of a transformation approach is metadata, Automated model TRAnsformations) frame- i.e., data representing software artifacts such as data 16,17 work, Kent Model Transformation lan- schemas, programs, interfaces, and models, then we 18,19 20,21 guage, Tefkat, GReAT (Graph Rewriting enter the realm of metaprogramming—writing pro- 22 and Transformation language ), ATL (Atlas grams called metaprograms that write or manipulate 23,24 25 Transformation Language ), UMLX, AToM3 other programs. One of the key challenges in this (A Tool for Multi-formalism and Meta-Model- realm is that metaprograms have to respect the rich 26 ing ), BOTL (Bidirectional Object-oriented semantics of the metadata upon which they operate. 27,28 Transformation Language ), MOLA (MOdel Similarly, model transformation is a form of 29 transformation LAnguage ), AGG (Attributed metaprogramming and, thus, must face the same 30 Graph Grammar system ), AMW (Atlas Model- challenge. 31 32 Weaver ), triple-graph grammars, MTL (Model 33 Model transformation is closely related to program Transformation Language ), YATL (Yet Another 51 34 35 transformation. In fact, their boundaries are not Transformation Language ), Kermeta, C-SAW 36 clear-cut, and both approaches overlap. Their (Constraint-Specification Aspect Weaver), and 37 differences occur in the mindsets and traditions of MT Model Transformation Language. their respective transformation communities, the 2. Described in the final adopted QVT specifica- subjects being transformed, and the sets of require- tion—The Core, Relations, and Operational lan- 15 ments being considered. Program transformation is guages. Older QVT submissions are also a more mature field with a strong programming mentioned whenever appropriate. language tradition. On the other hand, model 3. Implemented within open-source tools—Andro- 38 39 transformation is a relatively new field, essentially MDA, openArchitectureWare, Fujaba (From 40 rooted in software engineering. Consequently, the UML** to Java** And Back Again ), Jamda 41 transformation approaches found in both fields have (JAva Model Driven Architecture ), JET (Java 42 43 quite different characteristics. While program Emitter Templates ), FUUT-je, and MTF 44 transformation systems are typically based on (Model Transformation Framework ), which is a mathematically oriented concepts such as term freely available prototype. rewriting, attribute grammars, and functional pro- 4. Implemented within commercial tools—XMF-Mo- 45 46 47,48 gramming, model transformation systems usually saic, OptimalJ**, MetaEditþ**, ArcSty- 49 50 adopt an object-oriented approach for representing ler, and Codagen Architect. and manipulating their subject models. The feature model makes explicit the possible design Because model transformations operate on models, choices for a model transformation approach, which we need to clarify what models are. A model is an is the main contribution of this paper. We do not abstraction of a system or its environment, or both. give detailed classification data for each individual In software engineering, the term model is often approach mainly because these details are con- used to refer to abstractions above program code, stantly changing. Instead, we give examples of such as requirements and design specifications. approaches for each design choice. Furthermore, we Some authors in model-driven software develop- propose a clustering of existing approaches into a ment consider program code as models too. This few major categories that capture their main view is consistent with the fact that program code is characteristics and design choices. We conclude an abstraction of the underlying machine code with remarks on the practical applicability of the produced by the compiler. Although being visual is different categories. not a defining characteristic of models, requirements 622 CZARNECKI AND HELSEN IBM SYSTEMS JOURNAL, VOL 45, NO 3, 2006 Refers to Refers to Source Metamodel Transformation Definition Target Metamodel Conforms to Executes Conforms to Reads Writes Source Model Transformation Target Model Engine Figure 1 Basic concepts of model transformation and design models are often more visual than latter has been targeted for a particular set of programs. Models are frequently expressed in requirements that include the representation of focused languages specialized for a particular class models using an object-oriented paradigm, the of software applications or a particular aspect of an traceability among models at different levels of application. For example, the Matlab** Simulink**/ abstraction, the transformation mapping among Stateflow** environment offers notations special- multiple models (i.e., n-way transformations), and ized for modeling control software, whereas inter- the multidirectionality of transformations. Although action diagrams in Unified Modeling Language** these requirements could also be the subject of (UML**) are focused on representing the interaction program transformation approaches, they are typi- aspect of a wide range of systems. Highly special- cally not considered by program transformation ized modeling languages are increasingly referred to systems. as domain-specific modeling languages. EXAMPLES OF MODEL TRANSFORMATIONS In general, model transformations involve models To make our discussion more concrete, we present (in the sense of abstractions above program code) or two examples of model transformations: one that models and programs. Because the concept of maps models to models and another that maps models is more general than the concept of program models to code. code, model transformations tend to operate on a more diverse set of artifacts than program trans- Figure 1 gives an overview of the main concepts