Presentation is loading. Please wait.

Presentation is loading. Please wait.

(c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.1 AO Tools: State of the (AspectJ™) Art and Open Problems Mik Kersten.

Similar presentations


Presentation on theme: "(c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.1 AO Tools: State of the (AspectJ™) Art and Open Problems Mik Kersten."— Presentation transcript:

1 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.1 AO Tools: State of the (AspectJ™) Art and Open Problems Mik Kersten aspectj.org Palo Alto Research Center

2 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.2 good modularity XML parsing in org.apache.tomcat –red shows relevant lines of code –nicely fits in one box XML parsing

3 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.3 good modularity URL pattern matching in org.apache.tomcat –red shows relevant lines of code –nicely fits in two boxes (using inheritance) URL pattern matching

4 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.4 problems like… logging in org.apache.tomcat –red shows lines of code that handle logging –not in just one place –not even in a small number of places logging is not modularized

5 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.5 logging, zoomed in //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");

6 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.6 aspect PublicErrorLogging { Log log = new Log(); pointcut publicInterface (): call(public * org.apache.tomcat..*.*(..)); after() throwing (Error e): publicInterface() { log.write(e); } logging, modularized crosscutting concerns –tangled implementation  complex, difficult to maintain –modular implementation  can be clear, easy to maintain crosscutting concerns per se not complicated! captures public interface of tomcat package

7 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.7 crosscutting modularity 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)

8 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.8 that’s great, but… “how do I know what aspects affect my code?” “what will be executed?” “do you support my IDE?” “do you support Emacs?” “do you support Vi?”

9 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.9 where we are: crosscutting structure

10 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.10 crosscutting structure harder to show –not hierarchical –global structure –must be compatible with OO tools important to show –tool support helped OO win –advice invocation is implicit –hard to infer structure from source alone

11 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.11 demos… modularize concern build configurations crosscutting structure

12 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.12 where we are: tool platform support

13 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.13 multiple tool platforms development task-specific functionality –compilation & build management –editing & structure navigation –documentation must be presented consistently in –command line tools –IDEs Eclipse JBuilder NetBeans

14 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.14 netbeans screenshot…

15 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.15 ajbrowser screenshot…

16 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.16 emacs

17 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.17 jdee

18 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.18 ajdoc

19 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.19 tools architecture core framework provides –AspectJ-specific tool functionality –AspectJ structure model –GUI for Swing platforms –abstract UI and event model tool clients extend core –present task-specific views of crosscutting –goal is seamless integration with host platform

20 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.20 tools architecture overview

21 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.21 abstract structure model graph of program element nodes and associations longer lifecycle than AST, smaller footprint generic for AO and OO structure

22 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.22 where we are: unsolved problems

23 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.23 join point terminology several kinds of join points –method & constructor call –method & constructor execution –field get & set –exception handler execution –static & dynamic initialization a Line dispatch method call join points method execution join points

24 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.24 problems dynamic information (what actually executes) advice ordering runtime inspection (show abstraction, not execution) better build configuration support eager parsing

25 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.25 where we’re going: more problems…

26 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.26 enterprise apps, lifecycle

27 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.27

28 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.28 future work richer structure model –crosscutting (of classes) –crosscutting (of enterprise tiers, resources) –runtime (joinpoints, test suite) –emergent (evolution) better views –dynamic information –comprehensive refactoring –structure mining –version control –design and global structure

29 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.29 future work

30 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.30 logging (again) logging in org.apache.tomcat –red shows lines of code that handle logging –not in just one place –not even in a small number of places

31 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.31 demo: visualizer

32 (c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.32 credits AspectJ.org is a PARC project (partially funded by DARPA under contract F30602-97-C0246) Erik Hilsdale, Jim Hugunin, Wes Isberg, Mik Kersten and Gregor Kiczales download the tools and docs at: http://aspectj.org get the eclipse plug-in: http://eclipse.org/ajdt email the team: support@aspectj.org find more information on AOP: http://aosd.net 1.1 is coming!


Download ppt "(c) Copyright 1998-2002 Palo Alto Research Center Incroporated. All rights reserved.1 AO Tools: State of the (AspectJ™) Art and Open Problems Mik Kersten."

Similar presentations


Ads by Google