Presentation is loading. Please wait.

Presentation is loading. Please wait.

POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan An Extensible Aspect-Oriented Modeling.

Similar presentations


Presentation on theme: "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan An Extensible Aspect-Oriented Modeling."— Presentation transcript:

1 POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan http://posl.minnie.ai.kyutech.ac.jp/ An Extensible Aspect-Oriented Modeling Environment Naoyasu Ubayashi, Kazuhide Noda, Genya Otsubo, and Jun Yoshida CAiSE 2009 June 11, 2009

2 POSL posl.minnie.ai.kyutech.ac.jp 2 Today’s Talk -- Extensible AOM Environment Base Editor Meta Editor Reflective Model Editor Model Weaver (Compiler) Java Code Case Study & Evaluation DSML for Embedded Systems AOM: Aspect-Oriented Modeling DSML: Domain-Specific Modeling Language AspectM (UML-based AOM language) [Ubayashi, et al. 2005, 2006] Key Technologies Edit-time Structural Reflection Extensible Model Weaving

3 POSL posl.minnie.ai.kyutech.ac.jp 3 Outline An Overview of AspectM AspectM Support Tool Case Study & Evaluation Related Work Conclusion

4 POSL posl.minnie.ai.kyutech.ac.jp 4 1. An Overview of AspectM

5 POSL posl.minnie.ai.kyutech.ac.jp 5 AspectM: Crosscutting Concerns in Modeling AspectM JPM の簡易表も載 せる JPM (Join Point Model)Join pointAdvice PA (Pointcut & Advice)operationbefore, after, around CM (Composition)classmerge-by-name EL (Element)class diagramadd/delete/modify-class OC (Open Class)classadd/delete/modify-{attribute, operation} RN (Rename)class, attribute, operationrename RL (Rlation)classadd/delete/modify-{aggregation, relationship} IH (Inheritance)classadd/delete/modify-inheritance Pointcut cname(‘Customer’) || cname(‘Invoice’) Aspect name : Logging Advice Join Point Type : Open Class Add “log()”method to join point [JPM: AO Mechanisms] Model Weaving

6 POSL posl.minnie.ai.kyutech.ac.jp 6 There might be situations in which a modeler wants to introduce domain-specific notations and JPMs. But, … pointcut- body := !DCEntityContract_UniqueId_isUserAssigned(*) advice-body := >log() {isUserAssigned=false} {isUserAssigned=true}

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

8 POSL posl.minnie.ai.kyutech.ac.jp 8 MMAP Extension Points  Class, Attribute, Operation  PA, CM, EL, 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

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

10 POSL posl.minnie.ai.kyutech.ac.jp 10 2. AspectM Support Tool

11 POSL posl.minnie.ai.kyutech.ac.jp An Overview of AspectM Support Tool 11 Base Editor Meta Editor Reflective Model Editor Model Weaver (Compiler) Java Code

12 POSL posl.minnie.ai.kyutech.ac.jp 12 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 Implemented using Eclipse EMF/GMF

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 DSML component

17 POSL posl.minnie.ai.kyutech.ac.jp 17 Extensible Model Weaver Modeler Prolog Non Woven Model Fact write convert Woven Model Weaving Model Weaver analyze pointcut Model Editor define pointcut 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') -- from Invoice class meta-class-of('DCEntityContract', 'Invoice'), member-of('number', 'Invoice'), meta-class-of('UniqueId', 'number'), value-of('false', 'isUserAssigned'). -- from AspectM metamodel member-of('isUserAssigned', 'UniqueId'). !DCEntityContract_UniqueId_isUserAssigned selects a set of join points (classes) that satisfy the above facts (model)  ‘Invoice’

18 POSL posl.minnie.ai.kyutech.ac.jp 18 -- Constructing a DSML for Embedded Systems 3. Case Study & Evaluation

19 POSL posl.minnie.ai.kyutech.ac.jp Contexts in Embedded Systems Many embedded systems not only affect their contexts through actuators but also are affected by their contexts through sensors. However, requirements analysis is mainly conducted from the viewpoint of system functions, and contexts are only roughly analyzed. Embedded System Actuator Sensor Contexts Boundary ? Association ? 19 Unexpected behavior might emerge in a system if a developer does not recognize any possible conflicting combinations between the system and contexts. It is difficult to decide the boundary of contexts that should be taken into account: which contexts should be included as the targets of requirements analysis. CAMEmb

20 POSL posl.minnie.ai.kyutech.ac.jp Model Editor for CAMEmb Context model of a line trace car DSML (Domain-Specific Modeling Language) 20 > LEGO

21 POSL posl.minnie.ai.kyutech.ac.jp Metamodel Extension + OCL 21 Hardware should observe xor control contexts.

22 POSL posl.minnie.ai.kyutech.ac.jp Model Weaver for CAMEmb Total code size: 223 LOC Automatic generated code size: 174 LOC 78 % Context Model System Model Java Analysis ModelDesign ModelCode 22 Evaluation (Tasks for constructing DSL tool) (Task)(Number) [Editor] 1.Extend the metamodel8 [Editor] 2.Define meta-level OCLs8 [Weaver] 3.Define aspects commonly reused in CAMEmb3 [Weaver] 4.Define aspects specific to a line trace car11 [Weaver] 5.Reuse LEGO OS components4 Coded by hand

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 an implementation method for extensible AOM environments. Key technologies: –Edit-time structural reflection –Extensible model weaving

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

28 POSL posl.minnie.ai.kyutech.ac.jp Problems in Extensible AOM Languages 28 Extensible AOM Language A modeler can extend metamodel. A modeler can add new aspects that include user-defined AO mechanisms (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

29 POSL posl.minnie.ai.kyutech.ac.jp Model Verifyer (Assertion Checker) Assertions for checking (un)favorable properties 29 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 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


Download ppt "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan An Extensible Aspect-Oriented Modeling."

Similar presentations


Ads by Google