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

Info icon This 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
Image of page 1

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

View Full Document Right 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
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
Image of page 3

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

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

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

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

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

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

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

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

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

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

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

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

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

View Full Document Right Arrow Icon
16 Motivation By Allegory (13) Then you’d be a happy monarch!
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
Image of page 17

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern