1 A Parameterized Interpreter for Modeling Different AOP Mechanisms Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Genki Moriyama(Kyushu Institute.

Slides:



Advertisements
Similar presentations
A Brief Introduction to Aspect-Oriented Programming Zhenxiao Yang.
Advertisements

Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
1 An Aspect-Aware Outline Viewer Michihiro Horie and Shigeru Chiba Tokyo Institute of Technology, Japan.
1 modeling crosscutting in aspect-oriented mechanisms Hidehiko Masuhara (University of Tokyo) joint work with Gregor Kiczales (University of British Columbia)
Each design pattern is designed to facilitate one kind of change, i.e. changes in one dimension. However, software evolution can happen in multiple dimensions.
University of British Columbia Software Practices Lab Fluid AOP Join Point Models Terry Hon Gregor Kiczales.
Java.sun.com/javaone/sf | 2004 JavaOne SM Conference | Session BUS JavaOne 2004 What is AOP? Gregor Kiczales AspectMentor.com and University of.
359C 10/1/05 Eric Wohlstadter Introductions –Name –Degree objective/Year –Research Area (or interests) Syllabus Aspect-Oriented Programming –AspectJ –AspectC.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
1 Aspect Oriented Programming Programming Languages Seminar Presenter: Barış Aktemur University of Illinois 18 Feb Mostly taken from Bedir Tekinerdogan’s.
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
Software modularity group Gregor Kiczales Professor and NSERC/Xerox/Sierra Systems Software Design Chair University of British Columbia Principal Scientist.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
Session 15 Modeling Traceability of Concerns in Architectural Views Mark Stobbe October 29,
Aspect-Oriented Software Development (AOSD) Tutorial #3 AspectJ - continued.
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
Introduction to Aspect- Oriented Programming CS 3360 Gregor Kiczales, et. al. Getting started with AspectJ, CACM, 44(10):59-65, October Fall 2012.
An Introduction to AOP Original slides developed by Julie Waterhouse and Mik Kersten for OOPSLA 2004 AspectJ Tutorial ( kerstens.org/mik/publications/aspectj-
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Extensible Plug-ins for Aspect-Oriented Programming Macneil Shonle*Ankit Shah.
Tool support for crosscutting concerns of API documentation Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute.
1 An Aspect-oriented Weaving Mechanism Based on Component-and-Connector Architecture Naoyasu Ubayashi (Kyushu Institute of Technology) February 12, 2008.
Modularizing Web Services Management with AOP María Agustina Cibrán, Bart Verheecke { Maria.Cibran, System and Software Engineering.
MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other product or service names are the property of their respective.
1 Model Compiler Construction Based on Aspect-oriented Mechanisms Naoyasu Ubayashi (Kyushu Institute of Technology) Tetsuo Tamai (University of Tokyo)
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan An Extensible Aspect-Oriented Modeling.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
Aspect Oriented Programming Gülşah KARADUMAN.
Generative Programming. Automated Assembly Lines.
Kiczales and Mezini - FOAL AOP and Modular Reasoning [ICSE05] Start with first-principles definition of modularity and modular reasoning –localization,
1 Model Evolution with Aspect-oriented Mechanisms Naoyasu Ubayashi (Kyushu Institute of Technology) Tetsuo Tamai (University of Tokyo) Shinji Sano, Yusaku.
AOSD1 Aspect-Oriented Software Design Karl Lieberherr Theo Skotiniotis.
TRANSPARENT EXTENSION OF SINGLE- USER APPLICATIONS TO MULTI-USER REAL-TIME COLLABORATIVE SYSTEMS An Aspect Oriented Approach to Framework Integration ICEIS.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Devon M. Simmonds Computer Science Department, CSC592 1 Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington
Aspect-Oriented Programming and Modular Reasoning G. KiczalesM. Mezini Presented by Alex Berendeyev.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
1 Contract-based Verification for Aspect-oriented Refactoring Naoyasu Ubayashi(Kyushu Institute of Technology) Jinji Piao(Kyushu Institute of Technology)
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
AOP-Driven Variability in Software Product Lines Vander Alves, Ayla Dantas, and Paulo Borba Informatics Center – UFPE – Brazil
AOP and observer pattern. Design pattern General reusable solution to a commonly occurring problem in software design Not a finished design that can be.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Verification Mechanism for Weaving.
Extending the Field Access Pointcuts of AspectJ to Arrays ICS 2006 – Taipei, December 2006 Kung Chen and Chin-Hung Chien* National Chengchi University.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Reflective Aspect-oriented Model.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Adrian Colyer IBM Hursley OOPSLA, October
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
R R R A Brief Introduction to Aspect-Oriented Programming.
Introduction to Aspect- Oriented Programming CS 3360 Gregor Kiczales, et. al. Getting started with AspectJ, CACM, 44(10):59-65, October Spring 2012.
AspectScope: An Outline Viewer for AspectJ Programs Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
University of British Columbia Software Practices Lab Uniform Support for Modeling Crosscutting Structure Maria Tkatchenko Gregor Kiczales Work supported.
1 An AOP Implementation Framework for Extending Join Point Models Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Hidehiko Masuhara(University.
AO Mechanisms in Demeter1 Discussion with Gregor Kiczales at UBC Ontology of AOP Ontology is the study of what there is, an inventory of what exists. An.
1 Aspectual Caml an Aspect-Oriented Functional Language Hideaki Tatsuzawa Hidehiko Masuhara Akinori Yonezawa University of Tokyo.
PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan)
An Evolutional Cooperative Computation Based on Adaptation to Environment Naoyasu UBAYASHI and Tetsuo TAMAI Graduate School of Arts and Sciences University.
RoleEP: Role Based Evolutionary Programming for Cooperative Mobile Agent Applications Naoyasu UBAYASHI ( Toshiba Corporation) Tetsuo TAMAI ( University.
An Interface Mechanism for Encapsulating Weaving in Class-based AOP
MACS 2005 First International Workshop on the Modeling and Analysis of Concerns in Software Concern Management for Constructing Model Compilers -- Towards.
Discussion with Gregor Kiczales at UBC
Demeter Aspects Who We Are Aspectual Collaborations
A Brief Introduction to Aspect-Oriented Programming
Aspect-oriented programming
An Extensible Contract Verifier for AspectJ
Aspects at the Design Level
Presentation transcript:

1 A Parameterized Interpreter for Modeling Different AOP Mechanisms Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Genki Moriyama(Kyushu Institute of Technology, Japan) Hidehiko Masuhara(University of Tokyo, Japan) Tetsuo Tamai(University of Tokyo, Japan) November 10, 2005 ASE th IEEE/ACM International Conference on Automated Software Engineering Long Beach, California, USA, November 7-11, 2005

2 Outline  Motivation  X-ASB: A parameterized interpreter  Modeling different AOP mechanisms  Discussion towards reflection for AOP  Related work  Conclusion

3 1. Motivation

4 AOP Aspect-oriented programming (AOP) is a programming paradigm in which crosscutting concerns are modularized as aspects. Logging Error handling Synchronization Performance optimization

5 What is the essence of AOP ? Join points Means of identifying the join points Means of raising effects at the join points Join Point Model ! pointcut (AspectJ) advice (AspectJ) A mechanism for modularizing crosscutting concerns

6 Example -- AspectJ-like JPM class FigureElement { Display display; } class Point extends FigureElement { int x, y; int getX() { return x; } int getY() { return y; } void setX(int x) { this.x = x; } void setY(int y) { this.y = y; } } class Line extends FigureElement { Point p1, p2; int getP1() { return p1; } int getP2() { return p2; } void setP1(Point p1) { this.p1 = p1; } void setP2(Point p2) { this.p2 = p2; } } Display updating after (FigureElement fe): (call(void set*(..)) && target(fe) { fe.display.update(fe); } advice Pointcut

7 But, Current AOP languages … Each of current AOP languages is based on a few fixed set of JPMs. Many different JPMs have been proposed, and they are still evolving so that they better modularize various crosscutting concerns. need to explore common mechanisms in major JPMs !!

8 Three-part modeling framework A common structure in major four JPMs [Masuhara & Kiczales ECOOP2003]. PA- pointcuts and advice (as in AspectJ) TRAV- traversal specifications (as in Demeter, Northeastern Univ.) COMPOSITOR- class merges (as in Hyper/J or CME, IBM) OC- open classes (as in AspectJ inter-type declarations) traverse an object tree (e.g. crosscutting concerns over AST) visitor [TRAV] class Aclass B merge classes that crosscut each other [COMPOSITOR] class A insert crosscut concerns (fields/methods) to classes [OC] new fields new methods

9 Three-part modeling framework AB X JP X B ID Weave A ID The framework models the process of weaving as a tuple of nine parameters. A EFF B EFF X X JP A A ID A EFF B B ID B EFF META

10 Problem to be tackled Although the three-part modeling framework identified a common structure among different AOP mechanisms, the commonality is given in an informal manner. There has been no single model that captures all the different AOP mechanisms.

11 Our approach & contribution We present a single model that captures different AOP mechanisms, in the form of a parameterized interpreter that takes several parameters to cover different JPMs including PA, TRAV, COMPOSITOR, and OC. The interpreter will be helpful in rapid- prototyping a new AOP mechanism or a reflective AOP system that supports different mechanisms.

12 2. X-ASB: A parameterized interpreter

13 X-ASB -- extensible ASB Based on the three-part modeling framework. Built on ASB (Aspect SandBox), a suite of interpreters written in Scheme. [C. Dutchyn et al.] The interpreter consists of the core part and various sets of parameters. X-ASB param core part provide parameters interpreter for PA TRAV COMPOSITOR OC

14 Architecture (define weave (lambda (pgm-a pgm-b) (register-jp) (eval-program pgm-a pgm-b))) (define eval-program (lambda (pgm-a pgm-b) ( <iterate the following steps - get the next program element - generate a join point - call computation-at-jp> ))) (define computation-at-jp (lambda (jp) (effect-a (lookup-a jp)) (effect-b (lookup-b jp))))... other definitions weave (= interpreter) register-jp eval-program computation-at-jp X JP effect-a lookup-a lookup-b effect-b base (core part) parser common library

15 Parameters X X JP A A ID A EFF B B ID B EFF META Three-part modelX-ASB parameters eval-program computation-at-jp register-jp lookup-a effect-a lookup-b effect-b (included in register- jp) Coordination using a join point type Registration of a join point type

16 3. Modeling different AOP mechanisms

17 Interpreter construction steps Step1: Design a join point type using the register-jp parameter. Step2: Coordinate the computation at a join point using the computation-at-jp parameter. Step3: Design a weaving process using the eval-program parameter in which the computation-at-jp is called.

18 Step1: Design a join point type Example: PA (define-struct (call-jp jp) mname target args) (define-struct jtype (jname generator)) (define register-jp (lambda () (register-one-jp 'call-jp (lambda (mname target args) (make-call-jp 'b-control-a lookup-method execute-method lookup-advice execute-advice mname target args))))) join point name join point generator lookup-a effect-a lookup-b effect-b META (computation-strategy)

19 Step2: Coordinate the computation at a join point Example: PA (define computation-at-jp (lambda (jp) (let* ((lookup-a (jp-lookup-a jp)) (effect-a (jp-effect-a jp)) (lookup-b (jp-lookup-b jp)) (effect-b (jp-effect-b jp))) (effect-b (lookup-b jp) jp (lambda () (effect-a (lookup-a jp) jp)))))) lookup-method execute-method lookup-advice execute-advice computation-at-jp X JP effect-a lookup-a lookup-b effect-b extract from a join point type coordinate the computation

20 Step3: Design a weaving process Example: PA call computation-at-jp X JP effect-a lookup-a lookup-b effect-b call computation-at-jp X JP effect-a lookup-a lookup-b effect-b weaving process (define eval-program ( ) (define eval-exp (lambda (exp env) (cond ((method-call-exp? exp) (call-method …) ))) (define call-method (lambda (mname obj args) (computation-at-jp (jtype-generator (lookup-jp 'call-jp)) mname obj args))) base (parser) override parser

21 Design of the four JPMs PATRAV COMPOSITOR OC

22 What is the essence of modeling AOP mechanisms ? It is important for JPM developers to make the following design decisions: What kinds of join points are needed? What kinds of coordination should be defined at the join points?

23 LOC for developing each JPM We have only to add % new code to develop a new JPM. However, it is not necessarily easy to design the eval-program parameter. PartPATRAVCOM.OC 1. register-jp computation-at-jp eval-program base A: sum of 1 – B: sum of 1 – A / B (%)

24 LOC for extending PA We have only to add about 20 % new code to add a new kind of join point. It is easy to extend an existing JPM. Partoriginal PAadd fset-jpadd fget-jp 1. register-jp computation-at-jp 9 (reused) (reused) 3. eval-program sum of 1 – 3 A:154 B:48 B:42 B / (A+B) (%) field-set join point field-get join point

25 4. Discussion Towards reflection for AOP

26 Software evolution in AOP AOP is effective in unanticipated software evolution because crosscutting concerns can be added or removed without making invasive modifications to original programs. core concerns added removed core concerns core concerns concern space evolution crosscutting concerns

27 But, … Software evolution would be restricted if new crosscutting concerns cannot be described with the existing JPMs. core concerns new type of crosscutting concerns cannot be added core concerns core concerns concern space evolution crosscutting concerns

28 Evolution of JPMs Evolution by language developers Evolution by application developers The effectiveness in software evolution would be restricted if language developers must extend JPMs whenever application programmers need new kinds of JPMs. Reflection for AOP It would be better for application programmers to be able to add new JPMs using MOPs within the base language. Base level (program based on JPM) Meta level (implementati on of JPM) reify reflect MOPs for JPM extensions

29 From our experience It is relatively easy to design the register-jp parameter and the computation-at-jp parameter. It is not easy to design the eval-program parameter Reflection for AOP should be limited to adding new kinds of join point types and computation strategies.

30 Metaobject protocols for AOP JPM design layer LayerPurposeParameters level 1introductioneval-program of new JPMscomputation-at-jp register-jp level 2extensioncomputation-at-jp of existing JPMsregister-jp reflection for AOP MOP register-one-strategy lookup-strategy register-one-jp lookup-jp extract-jp register-one-pcd lookup-pcd extract-ptc extend computation-at-jp extend register-jp

31 5. Related Work

32 Related Work Versatile AOP kernel [E.Tanter et al., 2005] XAspect [M.Shonle et al., 2003] CME [IBM] Josh [S.Chiba and K.Nakagawa, 2004] abc: AspectBench Compiler [P.Avgustinov et al., 2005]

33 6. Conclusion

34 Conclusion We proposed the parameterized interpreter X-ASB for modeling different JPMs. X-ASB will be helpful in rapid-prototyping a new AOP mechanism or a reflective AOP system that supports multiple JPMs. X-ASB guides language developers in modular JPM designs.