Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute.

Similar presentations


Presentation on theme: "1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute."— Presentation transcript:

1 1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute of Technology, Japan) Yusaku Maeno(Kyushu Institute of Technology, Japan) Satoshi Murakami(Kyushu Institute of Technology, Japan) Tetsuo Tamai(University of Tokyo, Japan) 5 July 2006 SEKE 2006 Software Engineering and Knowledge Engineering

2 2 Overview  Motivation  Metamodel Access Protocol MMAP  Implementation  Related work  Conclusion

3 3 1. Motivation

4 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 5 AO Mechanism --- 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 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 7 AspectM classA attributes operations classB attributes operations classC attributes operations join point (class) classA || classB pointcut classA attributes new attributes operations new operations advice add new attributes add new operations Extension of JPM (Join Point Mechanism) in AOP classB attributes new attributes operations new operations join point (class) join point (class)

8 8 AspectM JPM JPMJoin pointPointcutAdvice PAoperation Example 1) setX || setY 2) set* 3) classA || classB 4) class* before, after, around CMclass merge-by-name NEclass-diagramadd-class delete-class OCclassadd-operation, delete-operation, add-attribute, delete-attribute RNclass, operation, attribute rename RLclassadd-inheritance, delete-inheritance, add-aggregation, delete-aggregation, add-relationship, delete-relationship PA ( pointcut & advice ), CM ( composition ), NE ( new element ), OC ( open class ), RN ( rename ), RL ( relation )

9 9 Example of AspectM descriptions > addAttributeX classeAandB : class { pointcut-body=“cname(classA) || cname(classB)” } merge [classAandB] : add-attribute { advice-body=“attributeX” } aspect cname(classA) || cname(classB) attributeX classA classB classC classA new attributes advice add new attributes pointcut classA || classB classB new attributes

10 10 AspectM is nice, but … Although AspectM provides major JPMs, there might be situations in which a modeler wants to define a JPM specific to an application. For example, a modeler wants to capture a group of methods that are targets of an application-specific logging or transaction. However, current aspect-oriented modeling languages including AspectM do not allow a modeler to extend JPMs.

11 11 We want to use application-specific rich vocabularies aspect class

12 12 Contribution We introduce a mechanisms called metamodel access protocol (MMAP) that allows an application modeler to access and modify the AspectM metamodel, an extension of the UML metamodel. MMAP enables a modeler to define a new JPM that includes application-specific join points, pointcut designators, and advice.

13 13 2. Metamodel access protocol MMAP

14 14 Two approaches for extending model elements in UML Lightweight An approach using UML profiles Heavyweight An approach that extends the UML metamodel by using MOF (Meta Object Facility), a language for modeling a metamodel

15 15 UML profile approach UML profiling mechanisms use stereotypes for introducing rich vocabularies. While an application modeler can easily introduce some kinds of application-specific JPMs, there are situations in which stereotypes as a mere annotation mechanism are insufficient: the typing of tags is weak; and we cannot declare new associations among UML metamodel elements.

16 16 Problems in UML profiles aspect class Stereotypes as annotations cannot describe relations among application-specific model elements including DCEntityContract, DCControllerContract, UniqueId, and DCLogger. Stereotypes as annotations cannot describe relations among application-specific model elements including DCEntityContract, DCControllerContract, UniqueId, and DCLogger.

17 17 MOF approach MOF approach is very strong because all of the metamodel elements can be extended. However, it is not easy for an application modeler to extend the UML metamodel by using the full power of the MOF.

18 18 Our approach -- MMAP Our approach is a middle weight approach that restricts available extension by MOF. MMAP (Metamodel Access Protocol) aims at introducing an application-specific JPM. An application modeler can access and modify the AspectM metamodel by using protocols exposed by MMAP. The target of MMAP is not a tool developer that needs full access to the AspectM metamodel but an application modeler that wants to introduce rich vocabulary at small cost.

19 19 Our concept AspectM metamodel AspectM model introduce a new kind of application-specific model element modify the AspectM metamodel reflect reify MMAP extension point new model element protocols model editor base level (MOF L1) base level (MOF L1) meta level (MOF L2) meta level (MOF L2) Editing-time reflection

20 20 MMAP Extension points  Class, Attribute, Operation  PA, CM, NE, OC, RN, RL Extension operations  define subclasses  add attributes to subclasses  create associations among subclasses Primitive predicates  predicates for navigating the AspectM metamodel AspectM metamodel

21 21 MMAP: Primitive predicates PredicateExplanation meta-class-of (mc, c)mc is a metaclass of c member-of (m, c)m is a member of a class c value-of (v, a)v is value of an attribute a super-class-of (c1, c2)c1 is a superclass of c2 related-to (c1, c2)c1 is related to c2

22 22 Example 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 model Meta model

23 23 MMAP vs. MOP The idea of MMAP originates in the mechanisms of extensible programming languages, such as metaobject protocol (MOP) and computational reflection. MOP is useful at the modeling-level although the targets of MOP are different from those of MMAP: the former focuses on execution behavior, and the latter focuses on model structures.

24 24 3. Implementation

25 25 Our Prototype AspectM Tools Prolog predicate s UML diagrams Aspect diagrams Model Editor XMI (from UML diagrams) XSLT: Model Tranformation (from Aspect diagrams) XMI (UML) Java code Model Compiler AspectM metamodel  AspectM metamodel and application models are transformed to a set of Prolog predicates.  Model transformation accesses these model elements by MMAP predicates.

26 26 4. Related work

27 27 Related Work Three-part modeling framework [ECOOP2003, H.Masuhara and G.Kiczales] Parameterized AO interpreter [ASE2005, N.Ubayashi et al.] XAspect [OOPSLA2003, M.Shonle, K.Lieberherr, and A.Shah] Versatile kernel for multi-language AOP [GPCE2005, E.Tanter and J.Noye] Extensible AOP language In AspectM, application-specific AOP features can be introduced by using MMAP.

28 28 Related Work (Cont’d) Domain-specific aspect-oriented modeling [GPCE2003, J.Gray] Domain-specific aspect orientation Reflective editor Edit-time metaobject protocol ETMOP [ODAL2006, A.D.Eisenberg and G.Kiczales

29 29 5. Conclusion

30 30 Conclusion We proposed MMAP that enables a modeler to define a new JPM that represents application-specific crosscutting concerns. Our approach is the first step towards extensible aspect-oriented modeling based on metamodel access protocols.


Download ppt "1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute."

Similar presentations


Ads by Google