PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan)

Slides:



Advertisements
Similar presentations
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
Advertisements

1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development.
1 An Aspect-Aware Outline Viewer Michihiro Horie and Shigeru Chiba Tokyo Institute of Technology, Japan.
Aspect Oriented Programming - AspectJ Radhika Rajput.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
July 19, th PPT, Ohokayama1 A Bytecode Translator for Distributed Execution of “ Legacy ” Java Software Michiaki Tatsubori University of Tsukuba,
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
Remote Method Invocation
Aspect-Oriented Programming In Eclipse ® Aspect-Oriented Programming in Eclipse with AspectJ Dr Helen Hawkins and Sian January.
University of British Columbia Software Practices Lab Fluid AOP Join Point Models Terry Hon Gregor Kiczales.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
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.
Aspect Oriented Programming Written by Michael Beder.
More on AspectJ. aspect MoveTracking { private static boolean _flag = false; public static boolean testAndClear() { boolean result = _flag; _flag = false;
1 Model Interface Implementation for Two-Way Obliviousness in Aspect-Oriented Modeling Presented by Wuliang Sun Department of Computer Science Baylor University.
Spring Roo CS476 Aleksey Bukin Peter Lew. What is Roo? Productivity tool Allows for easy creation of Enterprise Java applications Runs alongside existing.
Włodzimierz Funika, Filip Szura Automation of decision making for monitoring systems.
Introduction to Aspect- Oriented Programming CS 3360 Gregor Kiczales, et. al. Getting started with AspectJ, CACM, 44(10):59-65, October Fall 2012.
1 Aspects and Modularity: The Hope and the Challenge Jonathan Aldrich Institute for Software Research International School of Computer Science Carnegie.
Taming Obliviousness in Aspects with Data-flow Analysis and Design by Contract Tim Molderez and Dirk Janssens Ansymo Antwerp Systems and Software Modelling.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Aspect Oriented Programming (AOP) in.NET Brent Krueger 12/20/13.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Aspect Oriented Programming Scott Nykl CSSE 411 Senior Seminar.
Tool support for crosscutting concerns of API documentation Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) 1 A Small Extension to Java for Class Refinement ACM SAC'08, March 18, 2008.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development 1.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Using Aspects to Support the Software Process: XP over Eclipse Oren Mishali and Shmuel Katz Technion, Israel Institute of Technology.
A Novel Approach to Unit Test: The Aspect-Oriented Way Guoqing Xu and Zongyuan Yang Software Engineering Lab (SEL) East China Normal University
June 18-22, 2001ECOOP 2001, Budapest, Hungary1 A Bytecode Translator for Distributed Execution of “ Legacy ” Java Software Michiaki Tatsubori*, Toshiyuki.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
Aspect Oriented Programming Gülşah KARADUMAN.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
A Distributed Aspect-Oriented System for J2EE Applications Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) Background - As benefits.
AOSD1 Aspect-Oriented Software Design Karl Lieberherr Theo Skotiniotis.
A Presentation By V AIBHAV S AHARAN Web-enHanced Information Management COMS E6125.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
1 An Aspect-Oriented Implementation Method Sérgio Soares CIn – UFPE Orientador: Paulo Borba.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
AspectJ – AOP for Java Tom Janofsky. Instructor at Penn State Abington Consultant with Chariot Solutions JUG Member.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan 1 A Reflective Aspect-oriented Model.
Aspect Oriented Programming Adlux Consultancy Services Pvt Ltd
Comparison of Different AOP Approaches Presented by: Xiaojing Wang.
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
Introduction to Aspect- Oriented Programming CS 3360 Gregor Kiczales, et. al. Getting started with AspectJ, CACM, 44(10):59-65, October Spring 2012.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
AspectScope: An Outline Viewer for AspectJ Programs Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
Aspect-Oriented Software Development (AOSD)
1 An AOP Implementation Framework for Extending Join Point Models Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Hidehiko Masuhara(University.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
1 Aspectual Caml an Aspect-Oriented Functional Language Hideaki Tatsuzawa Hidehiko Masuhara Akinori Yonezawa University of Tokyo.
Implementing Distribution and Persistence Aspects with AspectJ WAS CLASS.
Chengyu Sun California State University, Los Angeles
Remote Method Invocation
Aspect-Oriented Generation of the API Documentation for AspectJ
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Aspect-Oriented Programming
Implementation of the INFOD System using AOP
Chengyu Sun California State University, Los Angeles
Distributed Dynamic Weaving is a Crosscutting Concern
Structuring Adaptive Applications using AspectJ and AOM
CS520 Web Programming Spring – Aspect Oriented Programming
Java Remote Method Invocation
Presentation transcript:

PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan) Michiaki Tatsubori (TRL, Japan IBM) To appear at AOSD ’ 04

PPL 2004, Gamagori, AICHI2 This Presentation  Our goal To modularize crosscutting concerns in distributed software  This presentation Background  AOP, crosscutting concern, AspectJ, … Motivating problem and example  A test code for distributed software Our solution  Remote pointcut  SPA ’ 04

PPL 2004, Gamagori, AICHI3 AOP (Aspect-Oriented Programming)  Separation of crosscutting concerns  What is a crosscutting concern? The implementation of the concern cuts across multiple modules Within confines of existing technology  E.g. OOP class Car { void start() { System.out.println(“start”); … … }} class Bike { void start() { System.out.println(“start”); … … }} Crosscutting concerns class Car { void start() { System.out.println(“start”); … … }} class Bike { void start() { System.out.println(“start”); … … }} aspect Log { before(): execution(void Car.start()) || execution(void Bike.start()) { System.out.println(“start”); }} exec

PPL 2004, Gamagori, AICHI4 AspectJ - General-purpose AOP Language for Java  Like event-driven model  Pointcut To identify join points Join poin (event)  Execution point in a program  E.g. method call, field access  Advice (action) Code that should be execute at each identified join point in pointcuts Before, after, and around aspect Log { before(): execution(void Car.start()) || execution(void Bike.start()) { System.out.println(“start”); }}

PPL 2004, Gamagori, AICHI5 Motivating Problem  Crosscutting concerns in distributed software AspectJ can separate them But, the implementation is NOT simple

PPL 2004, Gamagori, AICHI6 Test Code for Distributed Authentication Service  Confirm addUser() is executed on Database Client calls registerUser(), registerUser() calls addUser() Authenticator Database registerUser() Client addUser() Register a new user on a DB

PPL 2004, Gamagori, AICHI7 Ideal Design for Test Code  On Client, 1. flag = false. 2. call registerUser() on Authenticator. 3. if addUser() is executed on Database, then flag = true. 4. assert flag == true. Authenticator Database registerUser() addUser() Client

PPL 2004, Gamagori, AICHI8 Test Code in Java  Crosscutting concern Database code must be edited for test 1.Flag = false 2.Call registerUser() 3.assert flag == true class Database { void addUser() { invoke Callback … … add the user to the database } … … } Client Flag = true Callback Database Authenticator RMI (Remote Method Invocation) Crosscutting concern

PPL 2004, Gamagori, AICHI9 Test Code in Java and AspectJ  The concern is separated Database code is not edited 1.Flag = false 2.Call registerUser() 3.Assert flag == true Client Flag = true Callback class Database { void addUser() { … … add the user to the database } Database aspect DatabaseTest { before(): execution(void addUser()){ invoke Callback } DatabaseTest RMI

PPL 2004, Gamagori, AICHI10 This Design is Not Satisfactory  When writing the test code, we must consider two concerns: Test Distribution  It requires to divide the code into three sub-modules  Network processing (RMI) and deployment 1. flag = false. 2. call registerUser() on Authenticator. 3. if addUser() is invoked on Database, flag = true. 4. Assert flag == ture Three distributed sub-modules Don’t consider this!

PPL 2004, Gamagori, AICHI11 Our Solution - Remote Pointcut  To identify join points in a program on a remote host To run advice on a different host from the host where join points are pointcut Like RMI for distributed OOP class Database { void addUser() { … … } Remote pointcut aspect Log { before() : execution(void addUser()) { System.out.println(“addUser”); } Identified join point

PPL 2004, Gamagori, AICHI12 Test Code using a Remote Pointcut  Test program is a single non-distributed module Authenticator 1. flag = false 2. call registerUser() 3. assert flag == true before(): cflow(call(void registerUser())) &&execution(void addUser()){ flag = true } call addUser() Remote Pointcut class Database { void addUser() { } … … } Database AuthenticatorTest (Aspect) call registerUser()

PPL 2004, Gamagori, AICHI13 Test Code Implementation aspect AuthenticatorTest extends TestCase { boolean flag; void testRegisterUser() { flag = false; String userId = "muga", password = "xxx"; Authenticator auth = (Authenticator) Naming.lookup("auth"); auth.registerUser(userId, password); assertTrue(flag); } before(): // remote pointcut cflow(call(void Authenticator.registerUser())) && execution(void Database.addUser()) { flag = true; }} When addUser() is executed, the flag is set to true Confirms the flag is true Calls registerUser() Declares and initializes the flag

PPL 2004, Gamagori, AICHI14 DJcutter - Distributed AOP Language  It’s an extension of AspectJ language Remote pointcut Remote inter-type declaration  Load-time weaving Aspect weaving in DJcutter is performed at load-time

PPL 2004, Gamagori, AICHI15 DJcutter Language Specification  Pointcut DJcutter provides pointcut designators in AspectJ  Call, execution, within, target, … Hosts(Host, …)  The join points in execution on the hosts Cflow(Pointcut)  All join points that occur between the entry and exit of each join point specified by Pointcut  Advice Before, after, and around

PPL 2004, Gamagori, AICHI16 Remote Inter-type Declaration  To declare methods and fields in classes on a remote host Database aspect AuthenticatorTest { boolean Database.containsUser(String userId) { // If the user entry specified by userId is found // in the database. } boolean containsUser(); Append at load-time AuthenticatorTest

PPL 2004, Gamagori, AICHI17 Use of Remote Inter-type Declaration aspect AuthenticatorTest extends TestCase { void testRegisterUser() { String userId = "muga", password = "xxx"; Authenticator auth = (Authenticator) Naming.lookup("auth"); Database db = (Database) Naming.lookup(“db”); assertFalse(!db.containsUser(userId); auth.registerUser(userId, password); assertTrue(db.containsUser(userId)); } boolean Database.containsUser(String userId) { // If the user entry specified by userId is // found in the database. }} Confirms that the user entry

PPL 2004, Gamagori, AICHI18 DJcutter Implementation  Compiler To generate Java-bytecodes representing aspects  Runtime infrastructure To implement load-time weaving

PPL 2004, Gamagori, AICHI19 Load-time Weaving Aspect source file Java bytecode Compiler Aspect Server Class Loader entry Distributed software weave deploy Runtime Infrastructure

PPL 2004, Gamagori, AICHI20 Related Work 1  Middleware for automatic distribution E.g. J-Orchestra and Addistant They completely hide distribution concern Conbination of AspectJ and them We are not sure they are good for Tomcat, Oracle, …

PPL 2004, Gamagori, AICHI21 Related Work 2  Other distributed AOP languages E.g. D language framework JAC (Java Aspect Componenets) To modularize functional crosscutting concerns  DJcutter Remote pointcut To modularize non-functional crosscutting concerns

PPL 2004, Gamagori, AICHI22 Conclusion  Remote pointcut To transparently identify join points on remote hosts  Like RMI for distributed OOP To run advice on a different host from the host where join points are pointcut  Without consideration of distribution concern  DJcutter – Distributed AOP Language Remote pointcut Extension of AspectJ language

PPL 2004, Gamagori, AICHI23 The End  Thanks

PPL 2004, Gamagori, AICHI24

PPL 2004, Gamagori, AICHI25

PPL 2004, Gamagori, AICHI26 Even if writing RMI is very easy,  We still have a question: Why the test code consists of three sub- modules? Because of not test but distribution concern 1. flag = false. 2. call registerUser() on Authenticator. 3. if addUser() is invoked on Database, flag = true. 4. Assert flag == ture Design Problem

PPL 2004, Gamagori, AICHI27 DJcutter Implementation  Compiler To generate a Java-bytecode representing an aspect  Runtime infrastructure To implement load-time weaving  Aspect server  Extended class loader

PPL 2004, Gamagori, AICHI28

PPL 2004, Gamagori, AICHI29 Our Solution  To run advice on a different host from the host where join points are pointcut  Implementing a single module without consideration of distribution  That is, it can separate distribution concern from the test code Non-distributed sub-modules, Automatic deployment, And separation of crosscutting concerns

PPL 2004, Gamagori, AICHI30 Remote Pointcut  To identify join points in a program flow on remote host transparently Corresponding to RMI for distributed OOP Extends to pointcut designators in AspectJ  A single non-distributed module on a single host class Database { void addUser() { System.out.println(“addUser”); … … } Database Remote pointcut aspect Log { before() : execution(void addUser()) { System.out.println(“addUser”); } Log

PPL 2004, Gamagori, AICHI31 Three Distributed Sub-modules  Ideally, a concern should be described a non-distributed single module We want to write without consideration of distribution  The test code is written with consideration of distribution As a result, sub-modules, complicated network processing, deployment 1. flag = false. 2. call registerUser() on Authenticator. 3. if addUser() is invoked on Database, flag = true. 4. Assert flag == ture

PPL 2004, Gamagori, AICHI32 Three Distributed Sub-modules  Idealy, a concern should be described as a non-distributed single module on a single host  この test code は、分散した sub-modules に なっている Separated, but far from the ideal test code Remote method invocation among sub-modules Deployment Client Callback DatabaseTest RMI DatabaseTest Client Callback DatabaseTest

PPL 2004, Gamagori, AICHI33 Related Work

PPL 2004, Gamagori, AICHI34 Ideal Test Code  In the test code, we declare a flag for comfirming that addUser() was executed AuthenticatorTest Program call registerUser() 1. Sets flag to false 2. Remotely calls registerUser() 3. Confirms that flag is ture Flag is set to true, when addUser() is executed Main part for testing call addUser() class DbServer { void addUser() { … … } Database

PPL 2004, Gamagori, AICHI35 実際に実装する AuthServer DbServer AuthServerTest 1.registerUser() 呼出 2.addUser() 呼出 class AuthServerTest extends TestCase { boolean wasAddUserCalled; void testRegisterUser() { Naming.rebind("test", new RecieverImpl()); wasAddUserCalled = false; String userId = "muga", password = "xxx"; AuthServer auth = (AuthServer) Naming.lookup("auth"); auth.registerUser(userId, password); assertTrue(wasAddUserCalled); } class ReceiverImpl extends UnicastRemoteObject implements NotificationReceiver { void confirmCall() { wasAddUserCalled = true; } } interface NotificationReceiver { void confirmCall(); } aspect Notification { before(): execution(void DbServer.addUser()){ NotificationReceiver test = (NotificationReceiver) Naming.lookup("test"); test.confirmCall(); }} RMI

PPL 2004, Gamagori, AICHI36 Experimental Results