Comparison of Different AOP Approaches Presented by: Xiaojing Wang.

Slides:



Advertisements
Similar presentations
AspectWerkz 2 - and the road to AspectJ 5 Jonas Bonér Senior Software Engineer BEA Systems.
Advertisements

1..28 comparison of the leading aop tools report on February developerWorks articles Mik Kersten University of British Columbia.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
AspectWerkz Plain Java AOP Presented by: Gal Ostfeld January, 2005 Technion, Israel.
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
Overview of AspectJ Aspect Oriented Software Development Seminar Technion presented by Oren Mishali.
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.
Advice Weaving in AspectJ Alex Gontmakher. Outline Possible implementation approaches Quick JVM primer AJC implementation Performance Evaluation.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
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.
AspectWerkz Dynamic AOP For Java David Rabinowitz.
Review Amit Shabtay. March 3rd, 2004 Object Oriented Design Course 2 Review What have we done during the course? Where to learn more? What is for the.
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.
More on AspectJ. aspect MoveTracking { private static boolean _flag = false; public static boolean testAndClear() { boolean result = _flag; _flag = false;
Java Methods By J. W. Rider. Java Methods Modularity Declaring methods –Header, signature, prototype Static Void Local variables –this Return Reentrancy.
XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.
Introduction to Aspect- Oriented Programming CS 3360 Gregor Kiczales, et. al. Getting started with AspectJ, CACM, 44(10):59-65, October Fall 2012.
Modern Concurrency Abstractions for C# by Nick Benton, Luca Cardelli & C´EDRIC FOURNET Microsoft Research.
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.
Bologna, September 2003 Giorgia Lodi Department of Computer Science University of Bologna V.Ghini, F. Panzieri.
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.
Session 2: AspectJ Mark Stobbe September 13,
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.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Aspect Oriented Programming Gülşah KARADUMAN.
A Meta-Level Specification and Profile for AspectJ in UML Joerg Evermann School of Information Management Victoria University of Wellington.
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.
CCC: An Aspect-Oriented Intermediate Language on.Net Platform Yingfei Xiong and Feng Wan University of Electronic Science and Technology of China, China.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
Aspect-Oriented Programming and Modular Reasoning G. KiczalesM. Mezini Presented by Alex Berendeyev.
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Inter-Type Declarations in AspectJ Awais Rashid Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
AspectJ – AOP for Java Tom Janofsky. Instructor at Penn State Abington Consultant with Chariot Solutions JUG Member.
Course Progress Lecture 1 –Java data binding: Basket example: UML class diagram -> class dictionary without tokens-> language design -> class dictionary.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Checking LoD in AspectJ Show the idea, not the details. How can we precisely express it in a programming language?
Extending the Field Access Pointcuts of AspectJ to Arrays ICS 2006 – Taipei, December 2006 Kung Chen and Chin-Hung Chien* National Chengchi University.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring AOP – Part 2 Advanced Aspect-Oriented.
Aspect Oriented Programming Adlux Consultancy Services Pvt Ltd
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
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.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
SCoPE: an AspectJ Compiler for Supporting User-Defined Analysis-Based Pointcuts Tomoyuki Aotani Hidehiko Masuhara
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
AOP with AspectJ Awais Rashid, Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
1 Aspectual Caml an Aspect-Oriented Functional Language Hideaki Tatsuzawa Hidehiko Masuhara Akinori Yonezawa University of Tokyo.
AspectJ Development Tools Mik Kersten University of British Columbia October 28, 2003.
PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan)
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Chengyu Sun California State University, Los Angeles
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Aspect-Oriented Programming
Chengyu Sun California State University, Los Angeles
JAsCo an Aspect-Oriented approach tailored for
Structuring Adaptive Applications using AspectJ and AOM
Constructors, GUI’s(Using Swing) and ActionListner
CS520 Web Programming Spring – Aspect Oriented Programming
Aspect Oriented Programming
Presentation transcript:

Comparison of Different AOP Approaches Presented by: Xiaojing Wang

Outline  Problem  Related work  Comparison criteria  AOP Approaches for comparison  Results  Conclusion

Problem  Not fully matured  Evaluation is important

Related Work  Mik Kersten AspectJ, AspectWerkz, JBossAOP, SpringAOP how to handle AOP language mechanisms how to integrate with existing development tools, environments, and libraries  Konstantin Ignatyev CGLIB, Nanning, AspectWerkz,JBossAOP, and HiveMind use advice to count the number of invocations of a TestInterface method  Alexandre Vasseur AspectJ, AspectWerkz, JBossAOP, SpringAOP, CGLIB, and dynAOP use AWbench to measure the relative performance of AOP/Interceptor frameworks

Comparison Criteria  Pointcut  Advice  Aspect declaration

Terms – 1  Join point: well-defined points in execution of program  Pointcut: refers to collections of joint points and certain values at those join points  Advice: method-like constructs used to define additional behavior at joint points  Aspect: units of modular crosscutting implementation composed of pointcuts, advice, and ordinary Java member declarations.

Terms – 2  Inter-type declaration (also called introduction): additional fields, methods, constructors for classes  Weave: the process of inserting aspect code into other code, can be done at build time, load time, and run time.  Interceptor: an Aspect with only one advice named "invoke".  Mixin: a kind of generic type, can improve the flexibility of Java class hierarchies, thereby improving the ability to modularize code and compose features

AOP Approaches for Comparison  AspectJ  JBossAOP  Nanning

AspectJ  Extension to Java  Define its own keyword to implement Aspect  Pointcuts: 8 types Invocation, initialization, access, Exception handling, control flow, containment, conditional, and context  Pointcut operator: &&, || and !  3 types advice: before, after, and around

JBossAOP  plain Java class  Pointcuts  Pointcut operator: &&, || and !  Advice Using interceptor Using XML or annotation Only support around advice

Nanning  Consist of a set of mixins Interface, target-object, interceptors  Pointcuts Helper class P Pointcut pointcut = P.methodName("set.*");  Advice Using interceptor  Using dynamic proxy

Pointcut – 1 AOPinvocationinitializationaccess Exception handling AspectJ Method call/execution, Constructor call/execution Static-initialization initialization get set handler JBoss AOP Method call/execution, Constructor call/execution N/A field get set (via advice) NanningHelper class P

Pointcut – 2 AOP control flowcontainmentconditionalcontextoperator AspectJ Cflow cflowbelow within withincode if this target args && || ! JBoss AOP (via specified call stack) within Withincode hasfield has all (via dynamic cFlow) N/A && || ! Nanning Helper class P

Advice AOPAdvice AspectJ before after around JBoss AOParound Nanningaround

Aspect Declaration – AspectJ  Using Java-like code public class HelloWorld { public void say ( String msg ) { System.out.println ( msg ); } public static void main ( String[ ] args ) { new HelloWorld ( ).say ( "Hello, world! " ); } public aspect HelloWorldAspect { pointcut sayPoint ( ): execution (void HelloWorld.say ( String )); after( ): sayPoint( ) { System.out.println( "Over!" ); }

Aspect Declaration – JBossAOP // HelloWorldInterceptor.java import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; public class HelloWorldInterceptor implements Interceptor { public String getName(){ return "HelloWorldInterceptor"; } public Object invoke (Invocation invocation) throws Throwable { System.out.print ("Hello, "); // invokes next interceptor or actual method return invocation.invokeNext(); } // jboss-aop.xml

AspectInstance instance = new AspectInstance(); Mixin mixin = new Mixin(Interface.class, new Target( )); Method method = Interface.class.getMethod("call", null); mixin.addInterceptor(method, new MethodInterceptor( ) { public Object invoke(Invocation invocation) { System.out.println("Hello World! " + invocation.getMethod() + " was called!"); return invocation.invokeNext( ); } }); instance.addMixin(mixin); Interface proxy = (Interface) instance.getProxy( ); proxy.call(); Aspect Declaration – Nanning

Conclusion  AspectJ provides most complet pointcut and advice  JBossAOP ignores some uncommonly used pointcut and only uses around advice  Nanning is not a mature tool, which uses dynamic proxy to express aspect instead of join points, pointcut, and advice. But it is simple to learn and use.  Recommend to use: AspectJ

Questions?