a reflective aspect-oriented model editor based on metamodel extension

Post on 13-Jan-2016

37 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

MiSE2007 @ ICSE2007. A Reflective Aspect-oriented Model Editor Based on Metamodel Extension. Naoyasu Ubayashi and Genya Otsubo. May 20, 2007. Outline. AspectM. Motivation Management of Metamodel Extension Reflective Model Editor + Demonstration Related Work Conclusion. - PowerPoint PPT Presentation

TRANSCRIPT

POSL (Principles of Software Languages) Gr.Kyushu Institute of Technology, Japan

http://posl.minnie.ai.kyutech.ac.jp/

1

A Reflective Aspect-oriented Model Editor

Based on Metamodel Extension

Naoyasu Ubayashi and Genya Otsubo

MiSE2007 @ ICSE2007

May 20, 2007

2

POSLposl.minnie.ai.kyutech.ac.jp

Outline Motivation Management of Metamodel Extension Reflective Model Editor + Demonstration Related Work Conclusion

AspectM

3

POSLposl.minnie.ai.kyutech.ac.jp

1. Motivation

4

POSLposl.minnie.ai.kyutech.ac.jp

What is Aspect Orientation ?

Aspect-oriented programming (AOP) can separate crosscutting concerns including logging, error handling and transaction.

These concerns are modularized as aspects.

logging

5

POSLposl.minnie.ai.kyutech.ac.jp

AO Mechanism -- JPM--- JPM: Join Point Mechanism

aspect Logging { pointcut publiccall (): call (public * *(..)); before() : publiccall() {logging(); }}

join point

program execution points including method calls and field access points

pointcut advice

logging codeextract a set of join points related to a specific crosscutting concern from all join points

raise effects at the join points

AspectJAspectJ

6

POSLposl.minnie.ai.kyutech.ac.jp

Towards AO Modeling

Recently, aspect orientation has been proposed for coping with concerns at the early stages of the software development phases including requirements analysis, domain analysis, and architecture design phases.

We previously proposed a UML-based aspect-oriented modeling language called AspectM.

7

POSLposl.minnie.ai.kyutech.ac.jp

AspectM

AspectM JPM の簡易表も載せる

JPM Join point Advice

PA (Pointcut & Advice) operation before, after, around

CM (Composition) class merge-by-name

NE (New Element) class diagram add/delete-class

OC (Open Class) class add/delete-attribute, add/delete-operation

RN (Rename) class, attribute, operation rename

RL (Rlation) class add/delete-relationship, add/delete-aggregation

IH (Inheritance) class add/delete-inheritance

Aspects at the modeling-level are typically static structures

Pointcut cname(‘Customer’) || cname(‘Invoice’)

Aspect name : Logging

Advice Join Point Type : Open Class Add “log()”method to join point

8

POSLposl.minnie.ai.kyutech.ac.jp

There might be situations in which a modeler wants to introduce domain-specific notations and JPMs.

AspectM is nice, but …

pointcut-body := !DCEntityContract_UniqueId_isUserAssigned(*)advice-body := <<DCLoggerOperation>>log()

{isUserAssigned=false}

{isUserAssigned=false}

{isUserAssigned=true}

9

POSLposl.minnie.ai.kyutech.ac.jpNeed to extend the AspectM

metamodel

The metamodel is too complex !It is difficult for a modeler to extend and

modify the metamodel !

However, …

MOF is not easy !

10

POSLposl.minnie.ai.kyutech.ac.jp

Our Approach

Lightweight mechanism for extending the metamodel

Componentization of metamodel extension

We provide a model management method for extending the metamodel.

MMAP & Reflective Model Editor

DSL Components(Components for constructing UML-based DSL)

11

POSLposl.minnie.ai.kyutech.ac.jp

2. Management of Metamodel Extension

12

POSLposl.minnie.ai.kyutech.ac.jp

Concept -- MMAP, Reflective Model Editor and DSL Components

AspectM metamodel

AspectM model

introducea new kind of

domain-specificmodel element

modifythe AspectMmetamodel

reflect

reify

MMAP

extensionpoint

new modelelement

protocols

Reflective Model Editor

Base levelBase level

Meta levelMeta level

Editing-timestructuralreflection

DSLComponents

13

POSLposl.minnie.ai.kyutech.ac.jp

MMAP

Extension pointsClass, Attribute, OperationPA, CM, NE, OC, RN, RL, IH

Extension operationsdefine subclassesadd attributes to

subclassescreate associations

among subclassesadd constraints using

OCLPrimitive predicatespredicates for navigating

the AspectM metamodel

AspectM metamodelClass Element

Aspect Element

extension point example of extension operations

14

POSLposl.minnie.ai.kyutech.ac.jp

Metamodel navigation

DCEntityContract_UniqueId_isUserAssigned (c): meta-class-of ("DCEntityContract", c) && member-of (a, c) && meta-class-of ("UniqueId", a) && member-of ("isUserAssigned", "UniqueId") && value-of ("true", "isUserAssigned")

DCEntityContract_UniqueId_isUserAssigned (c): meta-class-of ("DCEntityContract", c) && member-of (a, c) && meta-class-of ("UniqueId", a) && member-of ("isUserAssigned", "UniqueId") && value-of ("true", "isUserAssigned")

meta-class-of

member-of

meta-class-of

member-of

value-ofBase level

Meta level

15

POSLposl.minnie.ai.kyutech.ac.jp

3. Reflective Model Editor

16

POSLposl.minnie.ai.kyutech.ac.jp

Overview of Reflective Model Editor

Base Editor

Meta Editor

1. Execute extension operations

2. Assign a graphic notation to a new model element

3. Regenerate the metamodel

4. Restart the base editor

Extension Procedure

17

POSLposl.minnie.ai.kyutech.ac.jp

Overview of Reflective Model EditorDemonstration

Base Editor

Meta Editor

1. Execute extension operations

2. Assign a graphic notation to a new model element

3. Regenerate the metamodel

4. Restart the base editor

Extension Procedure

Base Editor

Invoke the Meta Editor

18Meta Editor

Show an extension point

Create a new metaclass

Rebuild the Base Editor

Assign a graphic notation

Execute extension operations(add attribute, association, …)

Add a constraint using OCL

A class can have at most one UniqueId.

self.owner.feature ->select(oclIsTypeOf(UniqueId))->size() <= 1

19

New model elements are added to the pallet

Base Editor

This violates the constraint

A class can have at most one UniqueId.

self.owner.feature ->select(oclIsTypeOf(UniqueId))->size() <= 1

Base Editor can detect this error

20

Base Editor

Meta Editor

   Reusable DSL component

21

POSLposl.minnie.ai.kyutech.ac.jp

Base Editor

Implementation (1) -- Reflective Model Editor

Metamodel for EMF

Map model for GMF

Tool model for GMF

Graph model for GMF

Code Generator for EMF

Code Generator for GMF

Code ofModel Editor

Code ofGraphic Editor

Eclipse Modeling Framework

Graphical Modeling Framework

Extended Metamodel

Interface

Graphic Editor Generator

Modeler

Meta Editor

Core Editor Generator

22

POSLposl.minnie.ai.kyutech.ac.jp

Implementation (2) -- Model Weaver

Base Editor

ModelerProlog

Non WovenModel

Fact

write

convert

WovenModel

Weaving

Model Weaver

analyze pointcut

Model Editor

23

POSLposl.minnie.ai.kyutech.ac.jp

4. Related Work

24

POSLposl.minnie.ai.kyutech.ac.jp

Related Work AODM (Aspect-oriented Domain

Modeling) based on GME (Generic Modeling Environment) [J.Gray, et al. GPCE2003]

ETMOP (Edit-Time Metaobject Protocol) [A.D.Eisenberg and G.Kiczales, AOSD2007]

25

POSLposl.minnie.ai.kyutech.ac.jp

5. Conclusion

26

POSLposl.minnie.ai.kyutech.ac.jp

Conclusion

We proposed the notion of MMAP, reflective model editor and DSL components.

Future work– Verification of the metamodel extension– Verification of the model weaving

top related