A Distributed Aspect-Oriented System for J2EE Applications Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) Background - As benefits.

Slides:



Advertisements
Similar presentations
AspectWerkz 2 - and the road to AspectJ 5 Jonas Bonér Senior Software Engineer BEA Systems.
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 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.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
Remote Method Invocation
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
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.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
More on AspectJ. aspect MoveTracking { private static boolean _flag = false; public static boolean testAndClear() { boolean result = _flag; _flag = false;
Software Engineering Muhammad Fahad Khan
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
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.
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
J2EE Structure & Definitions Catie Welsh CSE 432
1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute.
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.
Modularizing Web Services Management with AOP María Agustina Cibrán, Bart Verheecke { Maria.Cibran, System and Software Engineering.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
Generative Programming. Automated Assembly Lines.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
SCALABLE EVOLUTION OF HIGHLY AVAILABLE SYSTEMS BY ABHISHEK ASOKAN 8/6/2004.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
AspectWrapper CHALFOUN Pierre et BUIST Éric. Overview Introduction – what and why In a nutshell – main components Our approach – how we did it Demo –
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.
Region Pointcut for AspectJ Shumpei Akai Shigeru Chiba Muga Nishizawa.
Dynamic and Selective Combination of Extension in Component-based Applications Eddy Truyen, Bart Vanhaute, Wouter Joosen, Pierre Verbaeten, Bo N. Jørgensen.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
Aspect Oriented Programming Adlux Consultancy Services Pvt Ltd
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
Secure middleware patterns E.B.Fernandez. Middleware security Architectures have been studied and several patterns exist Security aspects have not been.
Comparison of Different AOP Approaches Presented by: Xiaojing Wang.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
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.
Fault-tolerance for Component-based Systems – An Automated Middleware Specialization Approach Sumant Tambe* Akshay Dabholkar Aniruddha Gokhale Abhishek.
1 An AOP Implementation Framework for Extending Join Point Models Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Hidehiko Masuhara(University.
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.
PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan)
Software, IEE Proceedings, Vol.152, Num.3, June 2005,Page(s): Prasanthi.S March, Java-based component framework for dynamic reconfiguration.
RoleEP: Role Based Evolutionary Programming for Cooperative Mobile Agent Applications Naoyasu UBAYASHI ( Toshiba Corporation) Tetsuo TAMAI ( University.
Callbacks and Interceptors. Contents  Session Beans Life Cycle  Interceptors.
Software Engineering Lecture 7
An Interface Mechanism for Encapsulating Weaving in Class-based AOP
Broker in practice: Middleware
Chengyu Sun California State University, Los Angeles
Remote Method Invocation
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Enterprise Application Architecture
Aspect-Oriented Programming
Chengyu Sun California State University, Los Angeles
Distributed Dynamic Weaving is a Crosscutting Concern
JAsCo an Aspect-Oriented approach tailored for
CS520 Web Programming Spring – Aspect Oriented Programming
Leveraging ColdSpring To Make Better Applications
Presentation transcript:

A Distributed Aspect-Oriented System for J2EE Applications Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) Background - As benefits of AOP are getting recognized, a few AOP systems for J2EE have been developed before e.g. JBoss AOP, Spring AOP - J2EE is a distributed component framework for Java - However, they don’t provide new mechanisms specially developed for J2EE Motivating Example: Test code for distributed authentication service AuthTest (AspectBean) Authenticator DbAccess Deploy Deliver pointcut Load&weave - Once the user deploys an aspect, DJcutter … 1. acquires the pointcut information of the aspect 2. automatically delivers the information to each DJcutter 3. each DJcutter registers the information itself - Then the user orders DJcutter “weave”, DJcutter … 1. passes the operation to each DJcutter 2. Each DJcutter weave distributed software and aspect Client > Authenticator > DbAccess - One of the test programs confirms setUser () is actually executed on DbAccess if a client remotely calls registerUser () * The test includes a distributed crosscutting concern - DJcutter has a mechanism dedicated only for J2EE * Remote pointcut * Distributed weaving * It is implemented as one of services (MBean) on top of JBoss RC 1 Proposal DJcutter: A distributed AO system for J2EE Contribution 1: Remote Pointcut - Identifies join points in a program on a remote host - Advice is run on a host different from the host where join points are pointcut - Transparently - Like RMI for distributed OOP - For instance … aspect AuthTest implements AspectBean { 1. flag = false 2. calls registerUser() 3. assert flag == true before(): execution(void setUser()) { flag = true; }} class DbAccess implements SessionBean { void setUser() { … … } Contribution 2: Distributed Weaving Authenticator We could write the test program as a single non-distributed module on the client side DJcutter (MBean) EJB Container JBoss Deliver pointcut The users of DJcutter do not have to manually deliver the compiled aspects to every host Authenticator class DbAccess implements SessionBean { void setUser() { … … } class AuthTest 1. flag = false 2. calls registerUser() 3. assert flag == true class Callback Implements EntityBean flag = true aspect Notification { before(): execution(void setUser()) { invoke Callback; } DJcutter (MBean) EJB Container JBoss DJcutter (MBean) EJB Container JBoss registerUser () setUser () Remote Access Register a new user on a DB Problems - These AOP systems don’t support mechanisms for dealing with distributed crosscutting concerns - Concretely * the aspect separating such a concern consists of several distributed sub-components * Delivering software components to participating hosts is a bothersome work Remote pointcut The test concern is separated but, Three distributed sub-components Receiving a client request Adding the new user’s information on a DB - If the user writes the test program in existing AOP systems, …

Preplaned Dynamic Weaving Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) Background: Dynamic Weaving - Aspects can be composed, updated and removed into application at runtime - Benefits * Is that Aspects can be woven without restarting application * Improves efficiency of software development e.g.) Reduces downtime of web application Motivating Example: Unit Test for Client of server-side CustomerManager CustomerManager Motivation - Existing mechanisms for dynamic weaving are not acceptable for industry: low performance, lack of transparency, no-safety(?) e.g. * Using JPDA [Popovici ’03] * JVM’s extension [Bockisch ’04] - We want to use dynamic weaving more easily and simply +register(String): void class Aspect1 class A { void register(String name) { return ; class Aspect2 class A { void register(String name) { throw new Exception(“existing”); }}} void testRegisterNewCustomer() { //register a customer that does not already exist boolean couldRegister = new Client().register(NEW_CUSTOMER); assertTrue(couldRegister); } void testRegisterExistingCustomer() { //register a customer that does exist boolean couldNotRegister = ! new Client().register(EXISTING_CUSTOMER); assertTrue(couldNotRegister); } - By using dynamic weaving, we want to replace real collaborators’ implementations with mock implementations dynamically class Client { CustomerManager mgr; boolean register(String name) { try{ mgr.register(name); return true; } catch(Exception e) { return false; }}} - Replaces the real CustomerManager with mock objects - Changes the mock objects with respect to each test-method => dynamic weaving Overview of Our Aspects - Aspects can dynamically define/redefine/undefine fields and methods of other objects (similar to inter-type declarations) - The following aspects redefine method register() defined in void testRegisterNewCustomer() { // do something … void testRegisterExistingCustomer() { // do something … } class CustomerManager { // load-time weaving void register(String name) { switch(Weaver.getDeployed()) { // returns a hash code value case Aspect1’s hash : Aspect1_$$_register(name); return; case Aspect2’s hash : Aspect2_$$_register(name); return; default: original_$$_register(name); return; }} void Aspect1_$$_register(String name) { /* method body defined in Aspect1 class */ } void Aspect2_$$_register(String name) { /* method body defined in Aspect2 class */ } void original_$$_register(String name) { /* original method body */ } } - Traditional test driver’s code for this client Contribution - We proposed efficient dynamic weaving by using only bytecode transformation (without using other tools) (Note that, the aspects must be known at load-time) - These inter-type declarations allow us to redefine/extend implementations simply e.g. redefining mock implementations - Future work is to implement the mechanism for pointcut-advice, other inter-type declarations Implementation Within the ctl-flow of testRegNew() execution, Aspect1 is deployed Each register method Is used in a mock object for testing - By Aspect is dynamically deployed within the control flow of the execution of method annotated by it Registers a new customer How to test client’s register(..) - Aspects allow dynamically changing the behavior of software - but, those are woven into the rest of application at load-time for efficiency - Weavable aspects must be known before running application (but NOT a problem in practice) Proposal: Preplaned Dynamic Weaving TestDriver Calls the client actually