Presentation is loading. Please wait.

Presentation is loading. Please wait.

POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Verification Mechanism for Weaving.

Similar presentations


Presentation on theme: "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Verification Mechanism for Weaving."— Presentation transcript:

1 POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan http://posl.minnie.ai.kyutech.ac.jp/ 1 A Verification Mechanism for Weaving in Extensible AOM Languages Naoyasu Ubayashi, Yusaku Maeno, Kazuhide Noda and Genya Otsubo ADI2007 @ ECOOP2007 July 30, 2007

2 POSL posl.minnie.ai.kyutech.ac.jp 2 Outline Motivation AspectM: an extensible AOM language Verification mechanism Conclusion

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

4 POSL posl.minnie.ai.kyutech.ac.jp Extensible AOM language AOM (Aspect-oriented Modeling) languages can cope with concerns at the early stages of the software development phases. We previously proposed a UML-based AOM language called AspectM. AspectM is an extensible AOML based on MMAP (Metamodel Access Protocol). The extension mechanism in AspectM is effective for constructing domain-specific modeling languages. 4

5 POSL posl.minnie.ai.kyutech.ac.jp Problems in extensible AOM languages 5 Extensible AOM Language A modeler can extend metamodel. A modeler can add new aspects that include user-defined JPMs. (user-defined pointcuts, etc) Does a pointcut select join points correctly ? Does a base model conform to metamodel ? Does a woven model include cyclic inheritances? It is not necessarily easy to check model consistency and aspect interference. Verification mechanism

6 POSL posl.minnie.ai.kyutech.ac.jp 6 2. AspectM: an extensible AOM language

7 POSL posl.minnie.ai.kyutech.ac.jp 7 AspectM 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 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 … pointcut- body := !DCEntityContract_UniqueId_isUserAssigned(*) advice-body := >log() {isUserAssigned=false} {isUserAssigned=true}

9 POSL posl.minnie.ai.kyutech.ac.jp 9 AspectM extension mechanism 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

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

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

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

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

14 14 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

15 15 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

16 16 Base Editor Meta Editor Reusable DSL component

17 POSL posl.minnie.ai.kyutech.ac.jp 17 3. Verification mechanism

18 POSL posl.minnie.ai.kyutech.ac.jp What should be checked ? Structural correctness (Syntax check) Intention of a modeler (Semantic check) 18

19 POSL posl.minnie.ai.kyutech.ac.jp [Syntax Check] Structural correctness Consistency between base models and metamodel –Base models might not conform to metamodel if it evolves (metamodel can be modified by a modeler). –A woven model might not conform to metamodel even if each base model before weaving conforms to metamodel (aspects can be added by a modeler). –A woven model might include inference including name conflicts, multiple inheritance and cyclic inheritance. 19 Extended Metamodel V1 check conformance Extended Metamodel V2 Base model Woven model Extended Metamodel evolution (introduce new elements) weaving check conformance & inference

20 POSL posl.minnie.ai.kyutech.ac.jp Model structure checker 1. Generate a default schema from the original metamodel. 2. Check whether the metamodel is extended. 3. Redefine the schema if extended. 4. Check whether a base model conforms to the extended metamodel. 20 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : 9 : 10 : 11 : 12 : 13 : 14 : 15 :

21 POSL posl.minnie.ai.kyutech.ac.jp [Semantic Check] Intention of a modeler Assertions for checking (un)favorable properties –Captured join points might not be the points intended by a modeler. –Intended results might not be obtained when a modeler makes a mistake in specifying the precedence. –The mixture of illegal pointcut designators and illegal aspect precedence might cause an unexpected weaving. 21 Woven model check assertions Assertions super_class_of (c1, c2) attribute_of (a, c) operation_of (o, c) advice_of (a, o) class_exist (c) related_to (c1, c2) aggregate(c1, c2) composed_of (c1, c2) specified by predicates base and meta models can be navigated using predicates

22 POSL posl.minnie.ai.kyutech.ac.jp Assertion checker 1. Translate base and meta models into Prolog facts. 2. Generate Prolog queries from assertions. 3. Check the satisfiability. 22 A model represented in XML <ownedElement name="TransOp" xsi:type="asm:TransactionOperation" /> Prolog facts modelElement( [property('tagName', 'ownedElement'), property('name', 'TransOp'), property('xsi:type', 'asm:TransactionOperation')]) Assertion operation_of ('TransOp', 'C') Translate Check Assertion for checking the effect of a single aspect can be automatically generated.

23 POSL posl.minnie.ai.kyutech.ac.jp 23 4. Conclusion

24 POSL posl.minnie.ai.kyutech.ac.jp 24 Conclusion & Future work We clarified how the metamodel extension affects the verification of the weaving. We proposed a verification mechanism for weaving in extensible AOM languages. Currently, only simple cases are shown. We must prepare verification mechanisms corresponding to the purpose of AO modeling (Behavior modification, Refinement (MDA) …) Constraints specified in metamodel can be useful for verifying a weaving.

25 POSL posl.minnie.ai.kyutech.ac.jp Constraint preservation In AspectM, pre-/post-conditions and invariants can be specified for rigorous modeling. However, a weaving might break the constraint specified in a model before weaving. 25 What kind of weaving should be allowed ? For example, behavior subtyping ( MDA, … ), and so on. A first step towards verifying model weaver

26 POSL posl.minnie.ai.kyutech.ac.jp 26 Appendix

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

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


Download ppt "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Verification Mechanism for Weaving."

Similar presentations


Ads by Google