1..28 comparison of the leading aop tools report on February developerWorks articles Mik Kersten University of British Columbia.

Slides:



Advertisements
Similar presentations
Spring Roo and the Cloud Shekhar Gulati.
Advertisements

Object-Oriented Programming Session 9 Course : T Programming Language Concept Year : February 2011.
2006 Pearson Education, Inc. All rights reserved Object-Oriented Programming: Polymorphism.
Final and Abstract Classes
Classes and Objects in Java
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
© Near Infinity Corporation Using AOP for Enterprise Auditing of J2EE Applications AOSD Practitioners Report March 17, 2005.
AspectWerkz 2 - and the road to AspectJ 5 Jonas Bonér Senior Software Engineer BEA Systems.
4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
3 Copyright © 2005, Oracle. All rights reserved. Basic Java Syntax and Coding Conventions.
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
10 Copyright © 2005, Oracle. All rights reserved. Reusing Code with Inheritance and Polymorphism.
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
©2004 BLACKBOARD, INC. ALL RIGHTS RESERVED. Java Integrated Development Environments Heather Natour Senior Lead Engineer Blackboard Inc. July 18 th 10:15am.
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
Knowledge Extraction from Technical Documents Knowledge Extraction from Technical Documents *With first class-support for Feature Modeling Rehan Rauf,
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 5.
ITEC200 Week04 Lists and the Collection Interface.
Semantic Analysis and Symbol Tables
VOORBLAD.
31242/32549 Advanced Internet Programming Advanced Java Programming
© 2012 National Heart Foundation of Australia. Slide 2.
Lilian Blot VARIABLE SCOPE EXCEPTIONS FINAL WORD Final Lecture Spring 2014 TPOP 1.
Presentation 7 part 2: SOAP & WSDL.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
Towards a Standard Interface for Runtime Inspection in AOP Environments OOPSLA Workshop on Tool for AOSD, Seattle, November 2002 Katharina Mehner and Awais.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 13 - Exception Handling Outline 13.1 Introduction 13.2 Exception-Handling Overview 13.3 Other.
1 Abstract Class and Packages from Chapter 9 Lecture.
Languages for IT & CS Pseudo-code What HTML isn’t Early history Compiling & interpreting Classifying languages The process of programming.
From Model-based to Model-driven Design of User Interfaces.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
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.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
(c) Copyright Palo Alto Research Center Incroporated. All rights reserved.1 AO Tools: State of the (AspectJ™) Art and Open Problems Mik Kersten.
AOP and Aspect C++ presentation by Igor Kotenkov based on presentation by Andreas Gal, Daniel Lohmann and Olaf Spinczyk.
© 2005 UBC; made available under the EPL v1.0 mylar a degree-of-interest model for eclipse Mik Kersten Gail Murphy Shawn.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
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,
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
A Meta-Level Specification and Profile for AspectJ in UML Joerg Evermann School of Information Management Victoria University of Wellington.
Eclipse Eclipse An IDE is an Integrated Development Environment Different IDEs meet different needs – BlueJ, DrJava are designed as teaching.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
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.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Aspect Oriented Programming Adlux Consultancy Services Pvt Ltd
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
Comparison of Different AOP Approaches Presented by: Xiaojing Wang.
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.
Introduction to Yan Cui Aspect Oriented Programming by
AOP with AspectJ Awais Rashid, Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
AspectJ Development Tools Mik Kersten University of British Columbia October 28, 2003.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Andy Clement, George Harley IBM Hursley Labs.
Eclipse 27-Apr-17.
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Software Engineering Lecture 7
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Eclipse 20-Sep-18.
Plug-In Architecture Pattern
Presentation transcript:

1..28 comparison of the leading aop tools report on February developerWorks articles Mik Kersten University of British Columbia

2..28 Selecting the leading tools Which tools are suitable for commercial dev? –Over a dozen tools are listed on aosd.net –Early adopters harden new technologies –How active are the user communities of each? projectpostslist (november04 posts)url AspectJ each aspectj-users at eclipse.orgeclipse.org/aspectj AspectWerkzuser at aspectwerkz.codehaus.orgaspectwerkz.codehaus.org JBoss AOPaspects/jboss forumjboss.org/products/aop Spring AOPspringframework-userwww.springframework.org abc abc-users at comlab.ox.ac.ukabc.comlab.ox.ac.uk aspect#aspectsharp-usersaspectsharp.sourceforge.net AspectC++aspectc-user at aspect.orgaspectc.org JACjac-users at objectweb.orgjac.objectweb.org

3..28 projectpostslist (november04 posts)url AspectJ each aspectj-users at eclipse.orgeclipse.org/aspectj AspectWerkzuser at aspectwerkz.codehaus.orgaspectwerkz.codehaus.org JBoss AOPaspects/jboss forumjboss.org/products/aop Spring AOPspringframework-userwww.springframework.org abc abc-users at comlab.ox.ac.ukabc.comlab.ox.ac.uk aspect#aspectsharp-usersaspectsharp.sourceforge.net AspectC++aspectc-user at aspect.orgaspectc.org JACjac-users at objectweb.orgjac.objectweb.org Selecting the leading tools Which tools are suitable for commercial dev? –Over a dozen tools are listed on aosd.net –Early adopters harden new technologies –How active are the user communities of each?

4..28 What each has in common Join points –Where the main program and aspects meet Enabling mechanisms –Pointcuts: identify sets of join points –Advice: specify what action to take –Inter-type declarations: declare members –Aspects: contain aspect declarations –Composition: combine simple pointcuts –Naming: facilitates readability and composition –Abstraction: enables reuse –Exposing state: access executing program

1. language mechanisms 3. summary of tradeoffs 2. development environments

6..28 AspectJ Account authentication policy example, need –Pointcut to capture authenticated methods –Means of referring to Account –Advice to invoke the authentication

7..28 AspectWerkz

8..28 JBoss AOP

9..28 Spring AOP

Syntactic comparison Different styles: code, annotation, XML Consider editing advice involves in each –Pointcuts as strings vs. code –Localization of aspect declarations aspect declarations inter-type decls advice bodies pointcuts static enforcement configuration AspectJcode declare error/warning.lst inclusion list Aspect Werkz annotation or xml java method string value - aop.xml JBoss AOP jboss-aop.xml Spring AOP xml springconfig.xml

Code style vs. annotations and XML + Leverages familiarity with Java code and results in less typing and fewer errors + Pointcuts are first-class entities, which makes them easier to work with - For some declarative programming in XML is more familiar than Java language extensions - Advice to pointcut bindings cannot be controlled by the developer

Back to join points Kinds of join points, and their pointcuts –Invocation: code elements are called or executed –Initialization: of types and objects –Access: fields are read or written –Exception handling: of exceptions and errors Kindless pointcuts: –Control flow: within certain program control flows –Containment: places in the code contained within certain classes or methods –Conditional: at which a specified predicate is true

Join points and pointcuts join point kinds and kinded pointcutskindless pointcuts invocationinitializationaccess exception handling control flowcontainment condi- tional AspectJ {method, constructor, advice} x {call, execution} instance, static, pre- init field get/set handler cflow, cflowbelow within, withincode if Aspect Werkz instance, static within, withincode, has method/field - JBoss AOP instance (via advice) (via specified call stack) within, withincode, has method/ field, all (via Dynamic CFlow) Spring AOP method execution -- (via advice) cflow - custom pointcut Join points and pointcuts comparison

Expressiveness vs. simplicity - More to learn - Only a few pointcuts are required for coarse- grained crosscutting and auxiliary aspects + Many aspects cannot be expressed without fine-grained pointcuts + The learning curve for using new pointcuts is pay as you go

Join points and pointcuts Semantics Comparison pointcut matching pointcut composition advice forms dynamic context instantiated per exten- sibility AspectJ signature, type pattern, subtypes, wild card, annotation &&, ||, ! before, after, after returning, after throwing, around this, target, args, (all statically typed) vm, target, instance, cflow/below abstract pointcuts Aspect Werkz vm, class, instance, thread overriding, advice bindings JBoss AOP signature, instanceof, wild card, annotation around via reflective access vm, class, instance, join point Spring AOP regular expression &&, || before, after returning, around, throws class, instance

1. language mechanism 3. summary of tradeoffs 2. development environments

Building AOP programs Whats it like to adopt AOP on an existing project? sourcecompilercheckingweavingdeploymentrun AspectJ extended.java, or.aj incremental aspectj compile full static checking compile and load-time, produce bytecode static deployment plain Java program Aspect Werkz plain.java,.xml java compile, post processing minor static checking, none of pointcuts hot deployable JBoss AOP runtime interception and proxies framework invoked & managed Spring AOP java compile -

Static checking example Simple syntax error in pointcut

Language extension tradeoffs? - Tools that expect plain Java source must be extended to work on aspect code - Requires using a different compiler + Extended Java compiler provides full static checking of all aspect code + Writing and debugging pointcuts is much easier

IDE support: AJDT

IDE support: JBoss Eclipse plug-in

IDE support, libs, and docs ideeditorviewsdebuggerotherlibsdocs AspectJ eclipse, jdeveloper, jbuilder, netbeans highlighting, content assist, advice links outline, visualizer, cross references plain Java ajdoc, ajbrowser Aspect Werkz eclipse advice links---++ JBoss AOP advice links, UI for pointcut creation aspect manager, advised members dynamic deployment UI, jboss framework integration Spring AOP - spring framework integration ++++

1. language mechanisms 3. summary of tradeoffs 2. development environments

AspectJ - Language extension requires the use of an extended compiler and related tools - Lack of libraries + Concise aspect declarations and static checking for pointcuts + Mature IDE integration + Extensive documentation

AspectWerkz - Less concise aspect and pointcut declarations - Lack of static checking for pointcuts - Lack of libraries + Similar mechanisms as AspectJ without the language extension + Support for hot deployment of aspects

JBoss AOP - Lack of static checking for pointcuts - Advanced IDE features not yet supported + Rich set of enterprise aspects libraries are available and integrated with JBoss and JEMS + IDE support lowers adoption and reduces need to hand-code XML + Support for dynamic deployment of aspects

Spring AOP - Not suitable for fine-grained aspects - Lack of IDE support for working with aspects + Simple join point model is well suited to coarse-grained aspects and easier to learn + Spring framework integration, portability and ease of adoption for existing Spring users

1. language mechanisms 3. summary of tradeoffs questions 2. development tools

Around the corner: tools Better tool IDE support –Seamless integration Code model integration, search, refactoring, … –Crosscutting is explicit across all views Type hierarchy, call graph, synchronize –AOP centric features Pointcut queries, pointcut editing, library extension Join points and pointcuts –Use in other tools, e.g. debuggers, profilers

Around the corner AspectJ and AspectWerkz –AspectJ 5 will feature support for generics in pointcuts. syntax will support the AspectWerkz annotation style JBoss AOP –Static typing for parameters, performance improvements, libraries, and more IDE support features Spring AOP –Performance improvements, interoperability with AspectJ's pointcuts, and packaging of some Spring AOP services as AspectJ aspects

AOP vs. hand-coded crosscutting - Advanced IDE features such as refactoring are not yet supported + Aspects are inherent in complex systems, and without an AOP tool an implementation can become brittle and hard to evolve + Crosscutting becomes explicit, easy to reason about and change

Weaving Build time –Part of the standard compile if OOP compiler has been extended to AOP, or a post-compile step Load time –Identical to the compile-time weaving of aspect bytecodes, but done when classes are loaded Run time –Interception and proxy-based mechanisms provide a means for matching pointcuts to determine when advice should be invoked

Performance trade-offs of interception - Advice invocation overhead at run time, needed to determine pointcut matching + Negligible memory and time overhead when building