Presentation is loading. Please wait.

Presentation is loading. Please wait.

POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Reflective Aspect-oriented Model.

Similar presentations


Presentation on theme: "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Reflective Aspect-oriented Model."— Presentation transcript:

1 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 POSL posl.minnie.ai.kyutech.ac.jp 2 Outline Motivation Management of Metamodel Extension Reflective Model Editor + Demonstration Related Work Conclusion AspectM

3 POSL posl.minnie.ai.kyutech.ac.jp 3 1. Motivation

4 POSL posl.minnie.ai.kyutech.ac.jp 4 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 POSL posl.minnie.ai.kyutech.ac.jp 5 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 code extract a set of join points related to a specific crosscutting concern from all join points raise effects at the join points AspectJ

6 POSL posl.minnie.ai.kyutech.ac.jp 6 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 POSL posl.minnie.ai.kyutech.ac.jp 7 AspectM ・ DC における Logging の例( AspectM エ ディタで作成)。ただし、ここではモデ ル拡張していない版。 ・モデル weaving がわかるようにアニ メーションにする AspectM JPM の簡易表も載 せる JPMJoin pointAdvice PA (Pointcut & Advice)operationbefore, after, around CM (Composition)classmerge-by-name NE (New Element)class diagramadd/delete-class OC (Open Class)classadd/delete-attribute, add/delete-operation RN (Rename)class, attribute, operationrename RL (Rlation)classadd/delete-relationship, add/delete-aggregation IH (Inheritance)classadd/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 POSL posl.minnie.ai.kyutech.ac.jp 8 There might be situations in which a modeler wants to introduce domain-specific notations and JPMs. AspectM is nice, but … ・同じく DC における Logging 例。ただし、こ ちらはモデル拡張した版。 ・こちらもアニメーションにする pointcut- body := !DCEntityContract_UniqueId_isUserAssigned(*) advice-body := >log() {isUserAssigned=false} {isUserAssigned=true}

9 POSL posl.minnie.ai.kyutech.ac.jp 9 Need 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 POSL posl.minnie.ai.kyutech.ac.jp 10 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 POSL posl.minnie.ai.kyutech.ac.jp 11 2. Management of Metamodel Extension

12 POSL posl.minnie.ai.kyutech.ac.jp 12 Concept -- MMAP, Reflective Model Editor and DSL Components AspectM metamodel AspectM model introduce a new kind of domain-specific model element modify the AspectM metamodel reflect reify MMAP extension point new model element protocols Reflective Model Editor Base level Meta level Editing-time structural reflection DSL Components

13 POSL posl.minnie.ai.kyutech.ac.jp 13 MMAP Extension points  Class, Attribute, Operation  PA, CM, NE, OC, RN, RL, IH Extension operations  define subclasses  add attributes to subclasses  create associations among subclasses  add constraints using OCL Primitive predicates  predicates for navigating the AspectM metamodel 分かりやすい図に 置き換え! AspectM metamodel Class Element Aspect Element extension pointexample of extension operations

14 POSL posl.minnie.ai.kyutech.ac.jp 14 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-of Base level Meta level

15 POSL posl.minnie.ai.kyutech.ac.jp 15 3. Reflective Model Editor

16 POSL posl.minnie.ai.kyutech.ac.jp 16 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 POSL posl.minnie.ai.kyutech.ac.jp 17 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

18 18 Meta 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 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 20 Base Editor Meta Editor Reusable DSL component

21 POSL posl.minnie.ai.kyutech.ac.jp 21 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 of Model Editor Code of Graphic Editor Eclipse Modeling Framework Graphical Modeling Framework Extended Metamodel Interface Graphic Editor Generator Modeler 英語版に置き換え! Meta Editor Core Editor Generator

22 POSL posl.minnie.ai.kyutech.ac.jp 22 Implementation (2) -- Model Weaver 追加 Base Editor Modeler Prolog Non Woven Model Fact write convert Woven Model Weaving Model Weaver analyze pointcut Model Editor

23 POSL posl.minnie.ai.kyutech.ac.jp 23 4. Related Work

24 POSL posl.minnie.ai.kyutech.ac.jp 24 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 POSL posl.minnie.ai.kyutech.ac.jp 25 5. Conclusion

26 POSL posl.minnie.ai.kyutech.ac.jp 26 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


Download ppt "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Reflective Aspect-oriented Model."

Similar presentations


Ads by Google