1 / 29

An Extensible Aspect-Oriented Modeling Environment

CAiSE 2009. An Extensible Aspect-Oriented Modeling Environment. Naoyasu Ubayashi , Kazuhide Noda, Genya Otsubo , and Jun Yoshida. June 11, 2009. Today’s Talk -- Extensible AOM Environment. AspectM (UML-based AOM language) [ Ubayashi , et al. 2005, 2006] . Key Technologies

nasia
Télécharger la présentation

An Extensible Aspect-Oriented Modeling Environment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CAiSE 2009 An ExtensibleAspect-Oriented Modeling Environment NaoyasuUbayashi,Kazuhide Noda, GenyaOtsubo, and Jun Yoshida June 11, 2009

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

  3. Outline An Overview of AspectM AspectM Support Tool Case Study & Evaluation Related Work Conclusion

  4. 1. An Overview of AspectM

  5. Advice Join Point Type : Open Class Add “log()”method to join point AspectM: Crosscutting Concerns in Modeling Aspect name : Logging Pointcut cname(‘Customer’) || cname(‘Invoice’) Model Weaving [JPM: AO Mechanisms] AspectM JPMの簡易表も載せる

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

  7. AspectM metamodel AspectM model AspectM Extension Mechanism Meta level reify modify the AspectM metamodel protocols extension point DSL Components MMAP Editing-time structural reflection Base level reflect introduce a new kind of domain-specific model element new model element Reflective Model Editor

  8. MMAP AspectM metamodel Extension Points Class Element • 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 Aspect Element Primitive Predicates • predicates for navigating the AspectM metamodel extension point example of extension operations

  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") member-of meta-class-of meta-class-of Meta level member-of Base level value-of

  10. 2. AspectM Support Tool

  11. An Overview of AspectM Support Tool Model Weaver (Compiler) Base Editor Java Code Meta Editor Reflective Model Editor

  12. Reflective Model Editor Base Editor Extension Procedure Meta Editor Execute extension operations. Assign a graphic notation to a new model element. Regenerate the metamodel. Restart the base editor. Implemented using Eclipse EMF/GMF

  13. Demonstration Invoke the Meta Editor Overview of Reflective Model Editor Base Editor Extension Procedure Meta Editor Execute extension operations Assign a graphic notation to a new model element Regenerate the metamodel Restart the base editor Base Editor

  14. Add a constraint using OCL A class can have at most one UniqueId. self.owner.feature ->select(oclIsTypeOf(UniqueId))->size() <= 1 Show an extension point Rebuild the Base Editor Create a new metaclass Execute extension operations (add attribute, association, …) Assign a graphic notation Meta Editor

  15. 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 New model elements are added to the pallet Base Editor

  16. Reusable DSML component Meta Editor Base Editor

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

  18. 3. Case Study & Evaluation -- Constructing a DSML for Embedded Systems

  19. Contexts in Embedded Systems • 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 Association ? Boundary ? Embedded System Actuator Sensor Contexts 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.

  20. Model Editor for CAMEmb DSML (Domain-Specific Modeling Language) <<Context>> <<Hardware>> <<Sensor>> <<Actuator>> <<Observe>> <<Control>> <<Transfer>> <<Noise>> <<Affect>> LEGO Context model of a line trace car

  21. Metamodel Extension + OCL Hardware should observe xor control contexts.

  22. Model Weaver for CAMEmb Analysis Model Design Model Code Context Model Java Evaluation (Tasks for constructing DSL tool) (Task) (Number) [Editor] 1.Extend the metamodel 8 [Editor] 2.Define meta-level OCLs 8 [Weaver] 3.Define aspects commonly reused in CAMEmb 3 [Weaver] 4.Define aspects specific to a line trace car 11 [Weaver] 5.Reuse LEGO OS components 4 System Model Coded by hand Total code size: 223 LOC Automatic generated code size: 174 LOC 78 %

  23. 4. Related Work

  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. 5. Conclusion

  26. Conclusion • We proposed an implementation method for extensible AOM environments. • Key technologies: • Edit-time structural reflection • Extensible model weaving

  27. Appendix

  28. Problems in Extensible AOM Languages Verification Mechanism Does a base model conform to metamodel ? Does a woven model include cyclic inheritances? Does a pointcut select join points correctly ? Extensible AOM Language A modeler can extend metamodel. A modeler can add new aspects that include user-defined AO mechanisms (user-defined pointcuts, etc). It is not necessarily easy to check model consistency and aspect interference.

  29. Model Verifyer (Assertion Checker) 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')]) specified by predicates 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) Assertions Translate check assertions Check base and meta models can be navigated using predicates Woven model Assertion operation_of ('TransOp', 'C') Assertions for checking (un)favorableproperties

More Related