1 / 27

A Verification Mechanism for Weaving in Extensible AOM Languages

ADI2007 @ ECOOP2007. A Verification Mechanism for Weaving in Extensible AOM Languages. Naoyasu Ubayashi , Yusaku Maeno, Kazuhide Noda and Genya Otsubo. July 30, 2007. Outline. Motivation AspectM: an extensible AOM language Verification mechanism Conclusion. 1. Motivation.

anana
Download Presentation

A Verification Mechanism for Weaving in Extensible AOM Languages

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. ADI2007 @ ECOOP2007 A Verification Mechanismfor Weaving in Extensible AOM Languages Naoyasu Ubayashi, Yusaku Maeno, Kazuhide Noda and Genya Otsubo July 30, 2007

  2. Outline Motivation AspectM: an extensible AOM language Verification mechanism Conclusion

  3. 1. Motivation

  4. 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.

  5. 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 JPMs. (user-defined pointcuts, etc) It is not necessarily easy to check model consistency and aspect interference.

  6. 2. AspectM: an extensible AOM language

  7. Advice Join Point Type : Open Class Add “log()”method to join point AspectM Aspect name : Logging Pointcut cname(‘Customer’) || cname(‘Invoice’) AspectM JPMの簡易表も載せる

  8. AspectM is nice, 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.

  9. 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

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

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

  12. 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

  13. 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

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

  15. Reusable DSL component Meta Editor Base Editor

  16. 3. Verification mechanism

  17. What should be checked ? Structural correctness (Syntax check) Intention of a modeler (Semantic check)

  18. [Syntax Check] Structural correctness evolution (introduce new elements) Extended Metamodel V1 Extended Metamodel V2 Extended Metamodel check conformance & inference check conformance weaving Woven model Base model • 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. Model structure checker 1 :<xsd:complexType name="ClassType"> 2 : <xsd:choice maxOccurs="unbounded" minOccurs="0"> 3 : <xsd:element name="Attribute" type="AttributeType"/> 4 : <xsd:element name="Operation" type="OperationType"/> 5 : <xsd:element name=“TransactionOperation" type=" TransactionOperationType"/> 6 : </xsd:choice> 7 : <xsd:attribute name="name" type="Name" use="required"/> 8 : <xsd:attribute name="isAbstract" type="Boolean" use="optional"/> 9 : </xsd:complexType> 10 : 11 : <xsd:complexType name=" TransactionOperationType "> 12 : <xsd:complexContent> 13 : <xsd:extension base=“OperationType“/> 14 : </xsd:complexContent> 15 : </xsd:complexType> Generate a default schema from the original metamodel. Check whether the metamodel is extended. Redefine the schema if extended. Check whether a base model conforms to the extended metamodel.

  20. [Semantic Check] Intention of a modeler 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 check assertions base and meta models can be navigated using predicates Woven model • 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. 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')]) Assertion for checking the effect of a single aspectcan be automatically generated. Translate Check Assertion operation_of ('TransOp', 'C') Translate base and meta models into Prolog facts. Generate Prolog queries from assertions. Check the satisfiability.

  22. 4. Conclusion

  23. 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.

  24. Constraint preservation What kind of weaving should be allowed ? For example, behavior subtyping ( MDA, … ), and so on. A first step towards verifying model weaver 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. Appendix

  26. Implementation (1) -- Reflective model editor Core Editor Generator Modeler Eclipse Modeling Framework Code Generator for EMF Metamodel for EMF Code of Model Editor Meta Editor Map model for GMF Extended Metamodel Graphical Modeling Framework Tool model for GMF Base Editor Code Generator for GMF Code of Graphic Editor Graph model for GMF Graphic Editor Generator Interface

  27. Implementation (2) -- Model weaver Model Weaver Model Editor Weaving write Non Woven Model Woven Model Base Editor analyze pointcut convert Fact Modeler Prolog

More Related