On the Challenges of Composing Multi-View Models

Similar documents
Information Hiding and Aspect-Oriented Modeling

Aspect-Oriented Behavior Modeling In Practice

Unifying Software Reuse

Modeling the Evolution of Aspect Configurations using Model Transformations

On the Formalisation of GeKo: a Generic Aspect Models Weaver

Chapter 7. Modular Refactoring. 7.1 Introduction to Modular Refactoring

Expressing Feature-Based Variability in Structural Models

Static analysis and testing of executable DSL specification

An Aspect-Based Approach to Modeling Security Concerns

UML Aspect Specification Using Role Models

Designing Loop Condition Constraint Model for Join Point Designation Diagrams (JPDDs)

ASPECT GENERATOR. Audit Trail WEAVER. Aspect Editor. Weaving Strategies Editor. Model Editor. Mapping. Instructions. Original Model (XMI)

Reuse Contracts As Component Interface. Descriptions. Koen De Hondt, Carine Lucas, and Patrick Steyaert. Programming Technology Lab

Towards the integration of security patterns in UML Component-based Applications

Transformational Design with

Model Driven Production of Domain-Specific Modeling Tools

Pattern-Oriented Development with Rational Rose

Object Orientated Analysis and Design. Benjamin Kenwright

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

UML Specification and Correction of Object-Oriented Anti-patterns

Weaving Variability into Domain Metamodels

Aspect Weaving DyMAC middleware. by Tonje Klykken, INF5360 May 6th 2008

Aspect-Orientation from Design to Code

Approach for Modeling Aspects in Architectural Views

Model Composition - A Signature-Based Approach

A UML 2 Profile for Variability Models and their Dependency to Business Processes

LABORATORY 1 REVISION

Process DSL Transformation by Mappings Using Virtual Functional Views

Multi-Level Modelling in the Modelverse

Navigating the MetaMuddle

AUTOMATED COMPOSITION OF SEQUENCE DIAGRAMS

with openarchitectureware

A Unifying Framework for Homogeneous Model Composition

Metamodeling with Metamodels. Using. UML/MOF including OCL

Overview of AspectOPTIMA

Building Model-Driven Engineering Traceability Classifications

From Objects to Aspects: Assessing Modularity Evolution

Experimenting with Multi-Level Models in a Two-Level Modeling Tool

The TTC 2011 Reengineering Challenge Using MOLA and Higher-Order Transformations

Designing Interaction Spaces for Rich Internet Applications with UML

StarUML Documentation

2 nd UML 2 Semantics Symposium: Formal Semantics for UML

Object-Oriented Theories for Model Driven Architecture

Automation of Semantic Web based Digital Library using Unified Modeling Language Minal Bhise 1 1

QoS-aware model-driven SOA using SoaML

Idioms for Building Software Frameworks in AspectJ

An Introduction to Model Driven Engineering (MDE) Bahman Zamani, Ph.D. bahmanzamani.com

Integrating SysML and OWL

Detailed Description and User Guide

AUTOMATED BEHAVIOUR REFINEMENT USING INTERACTION PATTERNS

Weaving Aspects and Business Processes through Model Transformation

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Generic Modeling using UML extensions for variability

Chapter 2, Modeling with UML, Part 2

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

UNIT II. Syllabus. a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting

Composing Multi-View Aspect Models

Designing Aspect-Oriented Crosscutting in UML

Tool Support for Refactoring Duplicated OO Code

JOURNAL OF OBJECT TECHNOLOGY Online at Published by ETH Zurich, Chair of Software Engineering. JOT, 2002

Model Driven Development of Context Aware Software Systems

Specifying Precise Use Cases with Use Case Charts

Definition of Visual Language Editors Using Declarative Languages

Weaving Multiple Aspects in Sequence Diagrams

Introduction to. Bruno Harbulot. ESNW, the University of Manchester.

An Extensible Use Case Modeling Approach for Cyber- Physical Systems (CPSs)

DESIGN PATTERN MATCHING

JOURNAL OF OBJECT TECHNOLOGY

Open Reuse of Component Designs in OPM/Web

University of Groningen. Towards Variable Service Compositions Using VxBPEL Sun, Chang-ai; Aiello, Marco

Transaction Management in EJBs: Better Separation of Concerns With AOP

Story Driven Testing - SDT

Process-Integrated Refinement Patterns in UML

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

Chapter 8: Enhanced ER Model

Semantics Preservation of Sequence

On the link between Architectural Description Models and Modelica Analyses Models

A reference process for model composition

An Ontological Analysis of Metamodeling Languages

MERGING BUSINESS VOCABULARIES AND RULES

A Meta-Model for Composition Techniques in Object-Oriented Software Development

Mapping ConcurTaskTrees into UML 2.0

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

On Traceability of Informal Specifications for Model-Based Verification

A Meta-Level Specification and Profile for AspectJ in UML

AspectC++ A Language Overview

Model-Independent Differences

Computation Independent Model (CIM): Platform Independent Model (PIM): Platform Specific Model (PSM): Implementation Specific Model (ISM):

Issues surrounding model consistency and QVT

UML EXTENSIONS FOR MODELING REAL-TIME AND EMBEDDED SYSTEMS

Introducing the UML Eng. Mohammed T. Abo Alroos

On Using UML Profiles in ATL Transformations

A Case Study for HRT-UML

Aspect-Oriented Design with Reusable Aspect Models

PPOOA, An Architectural Style for Real Time Systems

Model Driven Development Unified Modeling Language (UML)

Separation of Navigation Routing Code in J2EE Web Applications

Outlook on Composite Type Labels in User-Defined Type Systems

Automatic Generation of Security-Aware GUI Models

Scenario-based Synthesis of Annotated Class Diagrams in UML

Transcription:

On the Challenges of Composing Multi-View Models Matthias Schöttle and Jörg Kienzle School of Computer Science, McGill University, Montreal, Canada mschoettle@cs.mcgill.ca, joerg.kienzle@mcgill.ca Abstract. The integration of compositional and multi-view modelling techniques is a promising research direction aimed at extending the applicability of model-driven engineering to the development of complex software-intensive systems. This paper outlines a general strategy for extending or integrating existing compositional modelling techniques into amulti-viewapproach.wedemonstratethepracticalityofourideaby explaining how we extended the Reusable Aspect Models (RAM) approach, which originally only supported structural modelling using class diagrams, with additional behavioural views based on sequence diagrams. This involved the integration of the metamodels as well as the model weavers. Introduction Model-Driven Engineering (MDE) [6] is a unified conceptual framework in which software development is seen as a process of model production, refinement and integration. Modelling is most effective when the properties of the system under development are modelled using the most appropriate modelling notations to express the properties of interest at the right level of abstraction. Models of the same system expressed in different modelling notations are called views. The ultimate goal of MDE is to obtain an executable model, e.g., in the form of source code. Therefore, it is necessary to integrate the different modelling notations that are used to describe the system, and to ensure that the different views are consistent with each other. Models of complex systems tend to grow in size, to a point where even individual views are difficult to understand or analyse. To reduce model complexity, model composition mechanisms have been proposed that allow modellers to combine several models of the same modelling notation into one []. While these mechanisms can be readily applied to compose models expressed in the same notation, they cannot be applied as such within multi-view modelling approaches. In this paper we outline a general approach for adapting existing composition mechanisms into a multi-view modelling context. The paper is structured as follows: Section 2 describes in general how to integrate an additional compositional modelling notation with an existing one to form a compositional multi-view modelling approach. Section 3 shows how we applied this idea in the context of the Reusable Aspect Models (RAM) [4] approach, which originally only supported structural modelling with class diagrams. We explain how we added an additional behavioural view that is based on sequence diagrams to the metamodel, and how we integrated the class diagram and sequence diagram weavers to correctly handle multi-view models. Finally, the last section draws some conclusions.

2 Integration Strategy This section describes a general strategy for integrating existing compositional modelling techniques into a multi-view approach. Our idea can also be applied when an existing compositional modelling approach is to be extended with an additional view. For the sake of clarity of the discussion, we describe in this section how two modelling notations I and D are integrated into a multi-view modelling notation I/D. Wefurtherassumethatatleastthemetamodeland composer for I of the modelling notations are defined. 2. Integrating the Metamodels The first step is to create a new metamodel that integrates I and D. Toensure that the two views are consistent with each other, it is important to unify the elements that represent concepts that are shared between I and D. The main idea of our strategy is to leave one of the metamodels untouched. We call this metamodel the independent metamodel MM I. The second metamodel, named the dependent metamodel MM D,ismodified(orcreated)insuchawaythat it builds on the first one, i.e., it references or reuses metamodel elements from MM I for all conceptually shared concepts. Modifying the second metamodel can be as simple as changing a reference to ametaclassdc in MM D to refer to the metaclass IC in MM I that represents the same shared concept. However, it can also involve more intricate changes. For example, a behavioural modelling notation could specify an action that is executed at a certain point in time using text: transfermoney(a,b,00) could signify that at a certain point an operation is invoked that transfers 00 dollars from account a to b. If this behavioural modelling notation is being integrated with a structural modelling notation that defines operations, then this text attribute should be replaced by a reference to the metaclass in the structural metamodel that represents an operation. 2.2 Updating the Model Composers The metamodel MM I was left untouched, and therefore the existing composer MC I still works as is, i.e., it can compose two models I and I 2 that are instances of MM I to produce a composed model I C.However,weadditionallyrequirethat MC I provides tracing information that details for each model element in I and I 2 to which element(s) in I C they were mapped to. Note that composers that support tracing typically already provide such information. Since MM D was modified, the composer MC D must be adapted to work with the new metamodel. This adaptation is rather straightforward, since the composition algorithm does not change. Only the parts that deal with the composition of the metamodel elements that now refer to MM I need to be updated. 2.3 Composition Algorithm This subsection describes an algorithm that uses the original composer MC I and the modified composer MC D to compose two multi-view models M and M 2.As depicted in the upper left corner of Fig., each source model consists of a part expressed using instances of MM I (shown as I x )andapartusinginstancesof

I M D I 2 M 2 D 2 I M D I 2 M 2 D 2 Step : compose copy Step 2: copy Step 3: update references D,c D2,c copy D,c Step 4: compose D2,c D c Fig.. Composition of Two Multi-View Models MM D (shown as D x ). Since MM D refers to MM I,someinstancesinD x refer to instances in I x. This is depicted using directed dashed lines. The multi-view composition algorithm proceeds in 4 steps:. First, I and I 2, i.e., the parts of the models that are expressed with the independent metamodel MM I,arecomposedusingtheunmodifiedcomposer MC I. This outputs a composed model M C, which so far contains the elements in I C (see result of step in upper left part), as well as tracing information on how elements in I and I 2 were mapped to elements in I C. 2. Next, the elements from D and D 2 are copied into M C (see step 2 in Fig. ). The result is an inconsistent model M C,becauseitcontainsexternalreferences (model elements in D x,c still refer to elements in I x of M x ). 3. The tracing information of step is then used to remove the external references to I and I 2, and replace them with references to the corresponding elements in I C (see step 3 in Fig. ). As a result, M C is now internally consistent, but still contains uncomposed elements (D,C and D 2,C ). 4. Finally, the modified composer MC D is invoked on D,C and D 2,C to yield the final composed model M C (see step 4 in Fig. ). 3 Integrating Message Views Into RAM Reusable Aspect Models (RAM) [4] is a compositional multi-view modelling approach for concern-oriented software design. On paper, a RAM model supports structural modelling using class diagrams (structural view), behaviouralmodelling with sequence diagrams (message views), and protocol modelling with state diagrams (state views). However, the TouchRAM tool [2] until recently only supported structural modelling. This section describes how the general integration strategy described above was used in the context of TouchRAM to integrate a compositional behavioural modelling notation with an already existing compositional structural modelling notation. Integrating the Metamodel and Updating the Composer: The metamodel of message views (MM MV ), shown in Fig. 2, is loosely based on UML

operations Classifier Operation Parameter parameter parameters specifies pointcut signature classes..* affectedby AspectMessageView Message - messagesort: MessageSort StructuralView messages..* structuralview interaction Aspect messageviews AbstractMessageView advice 0.. MessageView Interaction specification references MessageViewReference lifelines..* <<enum>> MessageSort synchcall createmessage deletemessage reply Lifeline ParameterValueMapping arguments assignto 0.. StructuralFeature properties Reference represents TypedElement Fig. 2. MessageView (white) integrated with the StructuralView Metamodel (grey) Sequence Diagrams [5]. It is heavily simplified, though, as UML supports different types of interaction diagrams. Furthermore, following the strategy outlined in section 2, we left the RAM structural view metamodel (MM SV )untouched, and made sure that the concepts in MM MV,thatalsoappearinMM SV,were implemented as references to MM SV.Forexample,aRAMMessage refers to an Operation in the structural view describing which operation is invoked, which in turn has a name and parameters. This is different from UML, where it is possible to supply a textual description as a message signature. The fact that MM SV is the independent metamodel (MM I )andmm MV the dependent one (MM D )is nicely illustrated in Fig. 2: The only associations between message view elements (white) and structural view elements (grey) are directed from white to grey. We also changed the structural weaver to generate a weaving information data structure that remembers for each element in the two input models to which output model element it was mapped to. RAM Composition Algorithm: In RAM, a model M can depend on a model M 2 to implement low-level design details. For that, M contains instantiations that map generic model elements of M 2 to model elements in M. Whenever two RAM models M and M 2 are composed, structural weaving is performed first (step ), combining the structural views to produce a woven model M C with the composed structure. This produces weaving information with the detailed composition mapping. Then, all message views from the lower-level model M 2 are copied into M C (step 2). At this point, the message views still refer to structural elements in M 2. Therefore, using the weaving information, all references are updated to refer to the right elements in M C (step 3). While M C already is a consistent model, the behaviour is still uncomposed. If desired, the RAM modeller can instruct TouchRAM to collect all message exchanges of a given behaviour within one message view (step 4). This is called message view inlining, and, when performed, results in replacing all operation invocations within a message view with the scenarios specified in the corresponding message views. This shows the modeller all behaviour that is executed when agivenoperationisinvokedinoneplace.

aspect Observer structural view Subject ~ Set< Observer> getobservers() + * modify(..) + addobserver( Observer) message view startobserving startobserving(s) <<impl>> Set myset int size ~ add( Observer ) mysubject 0.. target: Observer addobserver(target) Observer s: Subject add(target) Observer + startobserving( Subject) ~ update( Subject) myset: Set Subject Observer modify update I D aspect StockExchange depends on Observer structural view StockGUI + StockGUreate() + createwindow(stock stock) Stock - String name - int price + Stock create(string name, int price) + int getprice() + setprice(int price) StockWindow + StockWindow create(stock stock) ~ updatewindow(stock stock) Instantiation Observer: Subject Stock; Observer StockWindow; modify setprice; update updatewindow; message view createwindow target: StockGUI createwindow(stock) window := create(stock) window: StockWindow startobserving(stock) D 2 I 2 aspect StockExchange structural view StockGUI + StockGUreate() + createwindow (Stock stock) message view createwindow Stock - String name - int price + Stock create(string name, int price) + int getprice() + setprice(int price) ~ addobserver(stockwindow sw) target: StockGUI createwindow(stock) window := create(stock) startobserving(stock) <<impl>> Set myset...... 0.. mysubject window: StockWindow addobserver(window) StockWindow + StockWindow create( ) ~ updatewindow(stock stock) ~ startobserving(stock s) stock: Stock add(window) I C myset: Set Fig. 3. The Observer StockExchange and woven StockExchange Models D C 3. Composition Example The Observer RAM model shown in the top part of Fig. 3 describes the observer design pattern. Whenever a Subject is modified (i.e., the operation modify is called), it notifies all its Observers by calling their update operation. The Observer model is reused by StockExchange, which is depicted in the middle of Fig. 3. StockExchange defines a Stock class with a name and price. A StockWindow displays the information of a specific stock. The StockGUI is responsible for creating the overall user interface, i.e., windows displaying each stock. In order to reuse the Observer aspect, StockExchange has to map all partial classes of Observer (i.e., classes with a prefix)to elements in Stock- Exchange: Subject is mapped to Stock and Observer to StockWindow. Operations that modify the stock include the setter for the attribute price (setprice); updatewindow is the operation that refreshes the window with the updated information of a stock. The result of applying our composition algorithm is shown at the bottom of Fig. 3. The composition of the structural view merges all classes that are mapped in the instantiation directive, and copies the unmapped classes from the lower- to the higher-level aspect. For example, Stock and Subject are merged, but Set is

copied from Observer to StockExchange. After the structural view is composed, all message views are copied from Observer to StockExchange and the references updated to point to the classes of the StockExchange aspect. This results in a functional woven aspect with no dependencies. If the modeller subsequently wishes to see the complete behaviour of createwindow, she can perform message view inlining on this operation, which results in the message view createwindow shown at the very bottom of Fig. 3. 4 Conclusion This paper presented a strategy for integrating existing compositional modelling techniques into a multi-view approach(or, alternatively, for extending an existing technique with an additional view). We demonstrated the practicality of our strategy by extending TouchRAM, which supported compositional structural modelling with structural views (class diagrams), with behavioural views expressed using message views (sequence diagrams). The interested reader is referred to [7] for a detailed description of the integration of message views. How well the metamodels can be integrated depends heavily on how well the concepts from the independent metamodel MM I are aligned with the concepts of MM D. If the level of detail of MM I is higher (i.e. the mapping from MM D to MM I is one to many), it might be possible to add a new superclass into MM I. The composer must then be heavily updated. For example, we had to introduce asuperclasstypedelement for all elements with a type into the structural view metamodel in order to support message views. If the concepts in MM I are more general, then it might be possible to add new subclasses into MM I without affecting already existing models or the composer MC I. Based on our experience, we believe that our strategy is general, i.e., it can be applied to any compositional multi-view modelling approach, but further research has to be conducted to prove this. We are, however, confident, because we also used our strategy to successfully integrate state diagrams into TouchRAM, which is described in detail in [3]. References. Aspect-Oriented Modeling Workshop Series, http://www.aspect-modeling.org/ 2. Al Abed, W., Bonnet, V., Schöttle, M., Alam, O., Kienzle, J.: TouchRAM: A Multitouch-Enabled Tool for Aspect-Oriented Software Design. In: SLE 202. pp. 275 285. No. 7745 in LNCS, Springer (202) 3. Ayed, A., Kienzle, J.: Integrating Protocol Modelling into Reusable Aspect Models. In: Proceeding of BM-FA 203. pp. 2. ACM (July 203) 4. Kienzle, J., Al Abed, W., Klein, J.: Aspect-Oriented Multi-View Modeling. In: AOSD 09. pp. 87 98. ACM, New York, NY, USA (2009) 5. Object Management Group: OMG Unified Modeling Language (OMG UML), Superstructure (August 20), http://www.omg.org/spec/uml/2.4./, Version2.4. 6. Schmidt, D.C.: Guest Editor s Introduction: Model-Driven Engineering. IEEE Computer 39(2), 25 3 (2006) 7. Schöttle, M.: Aspect-Oriented Behavior Modeling In Practice. M.Sc. Thesis, Department of Computer Science, Karlsruhe University of Applied Sciences (September 202), http://mattsch.com/papers/masterthesis.pdf