15-aop

15-aop - Aspect Oriented Programming Aaron Bloomfield CS...

Info iconThis preview shows pages 1–18. Sign up to view the full content.

View Full Document Right Arrow Icon
Aspect Oriented Programming Aaron Bloomfield CS 216 Spring 2008 Slides adapted from Dave Matuszek (UPenn) and Westley Weimer
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Programming paradigms Procedural (or imperative) programming Executing a set of commands in a given sequence Fortran, C, Cobol Functional programming Evaluating a function defined in terms of other functions Scheme, Lisp, ML, OCaml Logic programming Proving a theorem by finding values for the free variables Prolog Object-oriented programming (OOP) Organizing a set of objects, each with its own set of responsibilities Smalltalk, Java, Ruby, C++ (to some extent) Aspect-oriented programming (AOP) = aka Aspect-Oriented Software Design (AOSD) Executing code whenever a program shows certain behaviors AspectJ (a Java extension), Aspect# , AspectC++ , … Does not replace O-O programming, but rather complements it
Background image of page 2
3 Why Learn Aspect-Oriented Design? Pragmatics – Google stats (as of 12-3-07): “object oriented” 3.6 million “guitar hero” 2.1 million “cobol” 1.3 million “design patterns” 0.2 million “extreme programming” 0.2 million “functional programming” 0.1 million “aspect oriented” or “AOSD” 0.03 million But it’s growing Just like OOP was years ago Especially in the Java / Eclipse / JBoss world
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Motivation By Allegory Imagine that you’re the ruler of a fantasy monarchy
Background image of page 4
5 Motivation By Allegory (2) You announce Wedding 1.0, but must increase security
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Motivation By Allegory (3) You must make changes everywhere: close the secret door
Background image of page 6
7 Motivation By Allegory (4) … form a brute squad …
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Motivation By Allegory (5) … clear the Thieves’ Forest …
Background image of page 8
9 Motivation By Allegory (6) … reduce the number of gate keys to 1 …
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 Motivation By Allegory (7) … kill your rival …
Background image of page 10
11 Motivation By Allegory (8) … double the guards at the gate …
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12 Motivation By Allegory (9) … secure the castle hallways …
Background image of page 12
13 Motivation By Allegory (10) … even reduce the length of the Wedding itself …
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
14 Motivation By Allegory (11) … you’re swamped – you’re not happy!
Background image of page 14
15 Motivation By Allegory (12) It’d be nice to separately advise: “Increase Security”
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
16 Motivation By Allegory (13) Then you’d be a happy monarch!
Background image of page 16
17 The problem Some programming tasks cannot be neatly encapsulated in objects, but must be scattered throughout the code Examples: Logging (tracking program behavior to a file) Profiling (determining where a program spends its time) Tracing (determining what methods are called when) Session tracking, session expiration Special security management
Background image of page 17

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 18
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/11/2009 for the course CS 216 taught by Professor Bloomfield during the Spring '08 term at UVA.

Page1 / 40

15-aop - Aspect Oriented Programming Aaron Bloomfield CS...

This preview shows document pages 1 - 18. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online