© 2 0 0 5-7 M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators - 1 - Handling Variability in Model Transformations and.

Slides:



Advertisements
Similar presentations
GenArch: Automatic Product Derivation in Multi-agent Systems Product Line Elder Cirilo.
Advertisements

.NET Technology. Introduction Overview of.NET What.NET means for Developers, Users and Businesses Two.NET Research Projects:.NET Generics AsmL.
MDI 2010, Oslo, Norway Behavioural Interoperability to Support Model-Driven Systems Integration Alek Radjenovic, Richard Paige The University of York,
Automated Test Design ™ © 2011 Conformiq, Inc. CONFORMIQ DESIGNER On ES v1.2.1 Stephan Schulz MBT Working Meeting/MTS#56, Göttingen.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
Verification/Simulati on –GUI for simulation and formal verification –Simulator: Exploration of dynamic behavior Checking.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Automated Analysis and Code Generation for Domain-Specific Models George Edwards Center for Systems and Software Engineering University of Southern California.
Software Factory Assembling Applications with Models, Patterns, Frameworks and Tools Anna Liu Senior Architect Advisor Microsoft Australia.
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
CS 290C: Formal Models for Web Software Lecture 6: Model Driven Development for Web Software with WebML Instructor: Tevfik Bultan.
A Family of Languages for Architecture Description OOPSLA 2008 Markus Voelter
Deriving AO Software Architectures using the AO-ADL Tool Suite Luis Fernández, Lidia Fuentes, Mónica Pinto, Juan A. Valenzuela Universidad de Málaga
Spectra Software Defined Radio Products Applying Model Driven Design, Generative Programming, and Agile Software Techniques to the SDR Domain OOPSLA '05.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Proceso kintamybių modeliavimas Modelling process variabilities Donatas Čiukšys.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
Java Beans.
Database Systems Group Department for Mathematics and Computer Science Lars Hamann, Martin Gogolla, Mirco Kuhlmann OCL-based Runtime Monitoring of JVM.
Faculty of Informatics and Information Technologies Slovak University of Technology Peter Kajsa and Ľubomír Majtás Design.
Workshop on Integrated Application of Formal Languages, Geneva J.Fischer Mappings, Use of MOF for Language Families Joachim Fischer Workshop on.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
MDA and QVT  Tom Gullion, Director of Product Management, Together Products.
Introduction to MDA (Model Driven Architecture) CYT.
Assessing the Suitability of UML for Modeling Software Architectures Nenad Medvidovic Computer Science Department University of Southern California Los.
Tools for Diagrammatic Specifications Stian Skjerveggen Supervisors: Yngve Lamo, Adrian Rutle, Uwe Egbert Wolter.
Building Tools by Model Transformations in Eclipse Oskars Vilitis, Audris Kalnins, Edgars Celms, Elina Kalnina, Agris Sostaks, Janis Barzdins Institute.
D O M A I N – D R I V E N D E V E L O P M E N T: Introduction i n g e n i e u r b ü r o f ü r s o f t w a r e t e c h n o l o g i e w w w. v o e l t e.
Model-Driven Analysis Frameworks for Embedded Systems George Edwards USC Center for Systems and Software Engineering
11 CORE Architecture Mauro Bruno, Monica Scannapieco, Carlo Vaccari, Giulia Vaste Antonino Virgillito, Diego Zardetto (Istat)
A Framework for the Reconfiguration of Ubicomp Systems Pau Giner, Carlos Cetina, Joan Fons, Vicente Pelechano.
Selected Topics in Software Engineering - Distributed Software Development.
Class 5 Architecture-Based Self-Healing Systems David Garlan Carnegie Mellon University.
1 5 Nov 2002 Risto Pohjonen, Juha-Pekka Tolvanen MetaCase Consulting AUTOMATED PRODUCTION OF FAMILY MEMBERS: LESSONS LEARNED.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
© Siemens AG, CT SE 2, Iris Groher, Markus Voelter C O R P O R A T E T E C H N O L O G Y XWeave – Models and Aspects in Concert 1 XWeave Models.
1 Context-dependent Product Line Practice for Constructing Reliable Embedded Systems Naoyasu UbayashiKyushu University, Japan Shin NakajimaNational Institute.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
© Siemens AG, CT SE 2 C O R P O R A T E T E C H N O L O G Y 1 Model-Driven Development for Pluggable Collaborations Iris Groher, Stephan Bleicher, Christa.
11 CORE Architecture Mauro Bruno, Monica Scannapieco, Carlo Vaccari, Giulia Vaste Antonino Virgillito, Diego Zardetto (Istat)
Inter-Type Declarations in AspectJ Awais Rashid Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
MDD approach for the Design of Context-Aware Applications.
EMEA Beat Schwegler Architect Microsoft EMEA HQ Ingo Rammer Principal Consultant thinktecture
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
SelfCon Foil no 1 Variability in Self-Adaptive Systems.
310414IMPLEMENTATION1 IMPLEMENTATIONIMPLEMENTATION SOFTWARE ENGINEERING SOFTWARE ENGINEERING.
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
AUTOMATIC GENERATION OF MODEL TRAVERSALS FROM METAMODEL DEFINITIONS Authors: Tomaž Lukman, Marjan Mernik, Zekai Demirezen, Barrett Bryant, Jeff Gray ACM.
Metadata Driven Aspect Specification Ricardo Ferreira, Ricardo Raminhos Uninova, Portugal Ana Moreira Universidade Nova de Lisboa, Portugal 7th International.
CHESS Methodology and Tool Federico Ciccozzi MBEES Meeting Sälen, January 2011 January 2011.
Leveraging ColdSpring to build a robust Flex applications Chris Scott, Cynergy Systems.
SysML v2 Formalism: Requirements & Benefits
Model-Driven Analysis Frameworks for Embedded Systems
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Towards an Open Meta Modeling Environment
Execute your Processes
Automated Analysis and Code Generation for Domain-Specific Models
On the notion of Variability in Software Product Lines
Graphical Modeling of INFOD applications
Software Development Process Using UML Recap
Software Architecture & Design
Presentation transcript:

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Handling Variability in Model Transformations and Generators DSM Workshop 2007 Markus Voelter This work is supported by

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Markus Völter Independent Consultant Based out of Göppingen, Germany Focus on Model-Driven Software Development Software Architecture Product Lines About me

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators AMPLE == Aspect-Oriented, Model-Driven Product Line Engineering (buzzwords are important to get funded ) EU-funded research project I am working with SIEMENS, building practically useful tooling and verifying it with a case study Resulting tooling based on Eclipse/openArchitectureWare and is freely available from eclipse.org/gmt/oaw Version 4.2 that includes all of them has been released Sept 17 About AMPLE

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Well-known (and much used) toolkit for most aspects of model-driven software development Open Source at Eclipse GMT integrates with many Eclipse Modeling projects (eg. EMF, GMF) Contributes to various Eclipse Modeling projects (Workflow Engine, Model-to-Text, Textual Modeling Framework) Version 4.2 is current, has been released Sept Some Features: Constraint Checking, Code Generation, Model-to-Model Transformation OCL-like expression language used throughout the tool Xtext Framework for building textual DSLs and Editors Support PLE in models, generators and transformations via AOP Editors and Debuggers for all those languages integrated in Eclipse About openArchitectureWare

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Software System Families Typically, MDD makes most sense in the context of software system families because developing modeling environments, generators, translators, etc. can be a lot of work and it pays only if reused. What is a software system familiy? We consider a set of programs to constitute a family whenever it is worthwhile to study programs from the set by first studying the common properties of the set and then determining the special properties of the individual family members. Definition by Parnas

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Structural vs. Non-Structural Variability Structural Variations Example Metamodel Non-Structural Variations Example Feature Models Dynamic Size, ElementType: int, Counter, Threadsafe Static Size (20), ElementType: String Dynamic Size, Speed-Optimized, Bounds Check Based on this sample metamodel, you can build a wide variety of models:

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators As mentioned above, the core challenge of product line implementation, is the implementation of the product variability. Models are more abstract and hence less detailed than code Thus, the variability is inherently less scattered, making variability management on model level simpler! What is MDD-AO-PLE

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators AO is used in several ways: On model level, we use it for weaving models and meta models In the transformation, we weave variants into transformations and generators And on code level, we use it to directly implement fine- grained implementation variants. We provide more details on all of these aspects later, as well as examples. Definition: MDD-AO-PLE uses models to describe product lines. Variants are defined on model-level. Transformations generate running applications. AO techniques are used to help define the variants in the models as well as in the transformers and generators. What is MDD-AO-PLE II

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Variability can be described more concisely since in addition to the traditional mechanisms, variability is also described on model level. The mapping from problem to solution domain can be formally described automated using model-to-model transformations. Aspect-oriented techniques enable the explicit expression and modularization of crosscutting variability on model, code, and generator level. Fine grained traceability is supported since tracing is done on model element level rather than on the level of artifacts. What is MDD-AO-PLE III

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators What is MDD-AO-PLE IV

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Intro to Case Study A home automation system called Smart Home. In homes you will find a wide range of electrical and electronic devices lights thermostats electric blinds fire and smoke detection sensors white goods such as washing machines as well as entertainment equipment. Smart Home connects those devices and enables inhabitants to monitor and control them from a common UI. The home network also allows the devices to coordinate their behavior in order to fulfill complex tasks without human intervention.

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Example House: Models and Transformations

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Orthogonal Variability Management Configuration models are “instances” of Feature Models. There is no variability left in them They are basically a list of selected features (there are also partial configurations and properties…) Feature Model From the perspective of a backend (i.e. generator, compiler, etc) only the configuration model is relevant! … as long as we expect that the configuration is valid wrt. to the feature model and we have implemented the generator correctly. Configuration Model

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Orthogonal Variability Management II Hence, oAW comes with a feature that allows domain architecture artifacts to depend on whether certain features are selected. An API is available that allows to plug in various feature modeling tools In the simplest case, that API can be bound to a simple text file that contains a list of selected features. Another binding is available to Pure Systems’ pure::variants tool That configuration model controls various aspects of the model transformation and code generation process. It is read at the beginning of the workflow and is available globally. Currently, we use it for the following optional features: Tracing Reflective Data Structures Viewer (UI) Automatic Windows

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Orthogonal Variability Management III The configuration is done via a pure::variants variant model (ps:vdm) pure::variants supports the interactive selection of features, while evaluating constraints and feature relationships to make sure only valid variants are defined. If a constraint is violated, the model is either automatically corrected, or an error is shown.

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Logging [Thumbnail]

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Logging, Implementation The implementation uses AO for the model transformation language. Here is the aspect: We advice ps2cbd::transformPs2Cbd We then execute the original definition (ctx.proceed()) Then we add, to the top level config, the Tracing Interceptor import psmm; import cbdmm; extension ps2cbd; extension org::openarchitectureware::util::stdlib::io; extension org::openarchitectureware::util::stdlib::naming; around ps2cbd::transformPs2Cbd( Building building ): let s = ctx.proceed(): ( building.createBuildingConfiguration(). deployedInterceptors.addAll( { utilitiesLib().interceptors.findByName("TracingInterceptor") } ) -> s );

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Logging, Implementation II Remember we only want to have these interceptors in the system iff the feature debug.tracing is selected in the global configuration model. That dependency is expressed in the workflow: The stuff inside the … tag is only executed if the respective feature is selected in the global configuration The XtendAdvice component type is an aspect component for the Xtend component used for transforming models. …

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Logging, Implementation III An Advice component basically takes the sub-elements and adds them to the component refenced by the adviceTarget attribute. In the case here, that target is the one that runs the PS to CBD M2M transformation Using this mechanism, the configuration of aspect code (the element is non-invasive. …

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Component State Viewer The viewer UI shown before is not generated. It is a generic piece of code that reflects on the data structures that it is supposed to render. To make this work, the following two additions have to be made to the generated system: The component state data structures must feature a generated reflection layer Whenever a component is instantiated in the activator, its state has to be registered with the viewer. These things are implemented using generator aspects, depending on the selection of the debug.viewer feature.

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Component State Viewer [Thumbnail]

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: State Viewer, Implementation Here are the respective feature-dependent aspects in the workflow This one happens on CBD level because the data implementations are independent of the runtime platform The second one influences the generation of the OSGI activator, since that one has to publish the component states once they are instantiated.

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators «AROUND data::api::data::body FOR ComplexType» «targetDef.proceed()» «EXPAND reflectionImplementation» «ENDAROUND» «AROUND data::api::data::imports FOR ComplexType» «targetDef.proceed()» import smarthome.common.platform.MemberMeta; import smarthome.common.platform.ComplexTypeMeta; «ENDAROUND» «DEFINE reflectionImplementation FOR ComplexType» private transient ComplexTypeMeta __meta = null; public ComplexTypeMeta __metaObject() { … } public void __metaSet( MemberMeta member, Object value ) { … } public Object __metaGet( MemberMeta member ) { … } «ENDDEFINE» Optional Feature: State Viewer, Implementation II reflectImpl.xpt adds around advice to a number of definitions in the code generation templates: some are pure hooks, i.e. they are empty! «DEFINE typeClass FOR ComplexType» «FILE fileName()» package «implClassPackage()»; «EXPAND imports» public class … { «EXPAND body» } «ENDFILE» «ENDDEFINE» «DEFINE imports FOR ComplexType»«ENDDEFINE» «DEFINE body FOR ComplexType» … «ENDDEFINE»

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: State Viewer, Implementation III reflect.ext adds a newly implemented interface to an existing extension function That original function is called from a template in order to find out which additional interfaces a data bean class needs to implement: The same mechanisms are used to “advice” the templates that generate the OSGi level code for the activator. around data::api::dataapiutils::implementedInterfaces(ComplexType this): ((Collection)ctx.proceed()).add("smarthome.common.platform.ReflectiveComplexType"); public class «implClassName()» «IF implementedInterfaces().size > 0»implements «ENDIF» «FOREACH implementedInterfaces() AS e SEPARATOR ", "»«e»«ENDFOREACH» { «EXPAND body» }

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Automatic Windows [Thumbnail]

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Burglar Alarm II Thumbnail: Here is (part of) the code: Note how we query the feature model from within the transformation instead of using aspects to contribute the additional behaviour to the transformation. create System transformPs2Cbd( Building building ): … hasFeature("burglarAlarm") ? ( handleBurglarAlarm() -> this) : this; handleBurglarAlarm( System this ): let conf = createBurglarConfig(): ( configurations.add( conf ) -> … conf.connectors.add( connectSimToPanel( createSimulatorInstance(), createControlPanelInstance() ) ) -> hasFeature( "siren" ) ? conf.addAlarmDevice("AlarmSiren") : null -> hasFeature( "bell" ) ? conf.addAlarmDevice("AlarmBell") : null -> hasFeature( "light" ) ? conf.addAlarmDevice("AlarmLight") : null );

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators Optional Feature: Burglar Alarm III It is also possible to access attributes of features (if the feature modeling tool supports attributes). Here we set the volume level of the siren: The feature model needs to have the level attribute, of course. handleBurglarAlarm( System this ): … isFeatureSelected( "siren" ) ? ( let siren = conf.addAlarmDevice("AlarmSiren"): siren.configParamValues.add( siren.createConfigParamForLevel() ) ) : null -> … ); private create ConfigParameterValue createConfigParamForLevel( ComponentInstance instance ): setName( "level" ) -> setValue((String)getFeatureAttributeValue( "siren", "level" ));

© M a rk u s V ö l t e r Handling Variability in Model Transformations and Generators The end. THANK YOU! QUESTIONS?