AspectJ Development Tools Mik Kersten University of British Columbia October 28, 2003.

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.
ASTA Aspect Software Testing Assistant Juha Gustafsson, Juha Taina, Jukka Viljamaa University of Helsinki.
©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.
An Overview of AspectJ Sabine Hauert. Today's Deserts  Whipped introduction served with its three berries syrup  Chocolate history soufflé  Design.
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
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.
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.
October - December 2013CSC5021: The Problem With Aspects (J P Gibson)1 The Problem With Aspects (AOP) A style of programming that attempts to abstract.
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.
(c) Copyright Palo Alto Research Center Incroporated. All rights reserved.1 AO Tools: State of the (AspectJ™) Art and Open Problems Mik Kersten.
AspectJ2EE/Clasa Israel Institute of Technology The Computer Science department Itay Maman.
Software modularity group Gregor Kiczales Professor and NSERC/Xerox/Sierra Systems Software Design Chair University of British Columbia Principal Scientist.
Technion Israel 1 Aspect-Oriented Software Development (AOSD) An Introduction Shmuel Katz Part of this lecture: Johan Brichau & Theo D’Hondt
Session 15 Modeling Traceability of Concerns in Architectural Views Mark Stobbe October 29,
Aspect-Oriented Programming with AspectJ™ AspectJ.org Xerox PARC Erik Hilsdale Gregor Kiczales with Bill Griswold, Jim Hugunin, Wes Isberg, Mik Kersten.
© 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 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.
Aspect-Oriented Programming with AspectJ Using slides from Jorrit N. Herder ( Mik Kersten ( aspectj.org Palo Alto.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Session 2: AspectJ Mark Stobbe September 13,
Reviewing Recent ICSE Proceedings For:.  Defining and Continuous Checking of Structural Program Dependencies  Automatic Inference of Structural Changes.
1 An Aspect-oriented Weaving Mechanism Based on Component-and-Connector Architecture Naoyasu Ubayashi (Kyushu Institute of Technology) February 12, 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.
Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton February 28th, 2003 Advisor: David G. Hannay Client:
Aspect Oriented Programming Gülşah KARADUMAN.
Kiczales and Mezini - FOAL AOP and Modular Reasoning [ICSE05] Start with first-principles definition of modularity and modular reasoning –localization,
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
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.
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.
Topics for exam in AOSD Basic concepts: tangling, scattering, joinpoint, advice, cross-cutting, weaving AspectJ: syntax, pointcut notations, around, proceed,
Eclipse. An IDE is an Integrated Development Environment Different IDEs meet different needs BlueJ, DrJava are designed as teaching tools Emphasis is.
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Aspect-Oriented Software Development (AOSD)
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Design Patterns David Talby. This Lecture Re-routing method calls Chain of Responsibility Coding partial algorithms Template Method The Singleton Pattern.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
AOP and observer pattern. Design pattern General reusable solution to a commonly occurring problem in software design Not a finished design that can be.
问题 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
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.
AspectScope: An Outline Viewer for AspectJ Programs Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
AOP with AspectJ Awais Rashid, Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Andy Clement, George Harley IBM Hursley Labs.
Software Engineering Lecture 7
An Interface Mechanism for Encapsulating Weaving in Class-based AOP
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Aspect-Oriented Programming
Systems Science For situations where tools are disjoint
Structuring Adaptive Applications using AspectJ and AOM
Aspect-oriented programming
Aspect Oriented Programming
ARV: Aspect Refactoring Verifier
Presentation transcript:

AspectJ Development Tools Mik Kersten University of British Columbia October 28, 2003

good modularity socket creation in Tomcat –colored lines show relevant lines of code –fits nicely into one package (3 classes)

pretty good modularity class loading in Tomcat –colored lines show relevant lines of code –mostly in one package (9 classes)

not so good modularity logging in Tomcat –scattered across the packages and classes –error handling, security, business rules, …

the cost of tangled code redundant code –same fragment of code in many places difficult to reason about –non-explicit structure –the big picture of the tangling isn’t clear difficult to change –have to find all the code involved –and be sure to change it consistently

the aop idea crosscutting is inherent in complex systems crosscutting concerns –have a clear purpose –have a natural structure so, let’s capture the structure of crosscutting concerns explicitly... –in a modular way –with linguistic and tool support aspects are –well-modularized crosscutting concerns

language overview I

a simple figure editor operations that move elements factory methods Display * 2 Point getX() getY() setX(int) setY(int) moveBy(int, int) Line getP1() getP2() setP1(Point) setP2(Point) moveBy(int, int) Figure makePoint(..) makeLine(..) FigureElement moveBy(int, int)

a Line a Point join points returning or throwing dispatch key points in the dynamic call graph a method call returning or throwing a method execution returning or throwing a method execution imagine l.move(2, 2)

join point terminology several kinds of join points –method & constructor execution –method & constructor call –field get & set –exception handler execution –static & dynamic initialization a Line dispatch method call join points method execution join points

pointcuts: naming join points each execution of the or method or a “void Line.setP2(Point)” execution name and parameters a “void Line.setP1(Point)” execution pointcut move(): execution(void Line.setP1(Point)) || execution(void Line.setP2(Point));

pointcut move(): execution(void Line.setP1(Point)) || execution(void Line.setP2(Point)); after() returning: move() { } advice: action under joinpoints a Line after advice runs “on the way back out”

a simple aspect aspect HistoryUpdating { pointcut move(): exucution(void Line.setP1(Point)) || execution(void Line.setP2(Point)); after() returning: move() { } an aspect defines a special class that can crosscut other classes

demo: modularize concern

comparison without AspectJ –no locus of “history updating” –evolution is cumbersome –changes in all classes –have to track & change all callers with AspectJ –clear “history updating” module –all changes in single aspect –evolution is modular

getting started II

adoption curve benefit enforcement testing debugging performance error handling management timing caching security domain aspects persistence feature management beyond OO AOP redefines services, middleware development timeinfrastructureAO architecture time & confidence reusable libraries aspects and classes for: development infrastructure business logic

logging (again) logging in Catalina –scattered across the packages and classes –error handling, security, business rules, …

logging (again) From ContextManager public void service( Request rrequest, Response rresponse ) { // log( "New request " + rrequest ); try { // System.out.print("A"); rrequest.setContextManager( this ); rrequest.setResponse(rresponse); rresponse.setRequest(rrequest); // wront request - parsing error int status=rresponse.getStatus(); if( status < 400 ) status= processRequest( rrequest ); if(status==0) status=authenticate( rrequest, rresponse ); if(status == 0) status=authorize( rrequest, rresponse ); if( status == 0 ) { rrequest.getWrapper().handleRequest(rrequest, rresponse); } else { // something went wrong handleError( rrequest, rresponse, null, status ); } } catch (Throwable t) { handleError( rrequest, rresponse, t, 0 ); } // System.out.print("B"); try { rresponse.finish(); rrequest.recycle(); rresponse.recycle(); } catch( Throwable ex ) { if(debug>0) log( "Error closing request " + ex); } // log( "Done with request " + rrequest ); // System.out.print("C"); return; } // log( "New request " + rrequest ); // System.out.print(“A”); // System.out.print("B"); // log("Done with request " + rrequest); if(debug>0) log("Error closing request " + ex); // System.out.print("C");

demo: development time aspects

crosscutting structure III

aspects crosscut classes aspect modularity cuts across class modularity HistoryUpdating Display * 2 Point getX() getY() setX(int) setY(int) moveBy(int, int) Line getP1() getP2() setP1(Point) setP2(Point) moveBy(int, int) Figure makePoint(..) makeLine(..) FigureElement moveBy(int, int)

showing crosscutting motivation –tool support helped OO win –advice invocation is implicit –difficult to infer structure from source alone challenges –compatibility with Eclipse –not hierarchical –global structure

new declarations ajdt 1.0 ajdt 1.1

new relationships pointcuts –execution, call –staticinitialization, initialization –get, set –handler, cflow,.. inter-type declarations –declare warning, error –fields and methods –declare parents –declare precedence

new views tree view links (outline) editor gutter annotations documentation (ajdoc) build configuration editor aspect visualizer…

demo: aspect visualizer

tools suite IV

jbuilder screenshot…

netbeans screenshot…

ajbrowser screenshot…

emacs

ajdoc

extensibility overview

engineering challenges eclipse sets the bar high –eager parsing and code assist –refactoring integration with the JDT –java model is not inherently extensible –structure searches don’t work for crosscutting keeping up with the platforms –eclipse versions –jdk 1.5 generics and metadata

what’s next? show inheritance –abstract aspects –declare parents show dynamic info –aspect precedence –cflow call graphs crosscutting navigator

summary aop –same benefits of good modularity –but for crosscutting concerns aspectj –join points, pointcuts, advice, … –getting started with auxiliary aspects tool support –crosscutting structure is explicit

aspectj credits eclipse.org Technology PMC project versions developed at Xerox PARC aspectj team –Adrian Colyer, Erik Hilsdale, Jim Hugunin, Wes Isberg and Mik Kersten ajdt team –Adrian Colyer, Andy Clement, Mik Kersten and Julie Waterhouse Park