Controlling the Complexity of Software Designs PowerPoint PPT Presentation

presentation player overlay
1 / 9
About This Presentation
Transcript and Presenter's Notes

Title: Controlling the Complexity of Software Designs


1
Controlling the Complexity of Software Designs
pp. 2 11
  • Karl J. Lieberherr
  • 26th International Conference on Software
    Engineering (2004)

Poster by John Volk
2
Aspect Oriented Programming
  • Attempts to isolate concerns that cross-cut an
    entire application into abstractions called
    aspects.
  • For each aspect that a developer wants to
    encapsulate, he or she must define the join
    points at which this code needs to be executed,
    and the block of code itself.

3
Law of Demeter (LoD)
  • Talk only to your friends.
  • Only allowed to send messages to objects supplied
    in the arguments to a method (including this), or
    objects created in the method.
  • Simplifies code by minimizing the number of
    modules to which a single module can refer.

4
Law of Demeter for Concerns
  • Stricter form of LoD.
  • Has the same restrictions as LoD, but adds one
  • Modules are not permitted to send messages to
    other modules if those modules do not contribute
    to the current concern.
  • Concern Any issue that the designer/programmer
    is concerned with, e.g., the synchronization
    policy of a system, the implementation of a use
    case, or the exception handling policy of a
    system.

5
Example Logging
  • You want to add logging for important events to
    an existing software system.
  • First Option
  • Decide which events needs to be logged, find the
    code where those events occur, add calls to some
    logging component in the necessary places.
  • Problems with this approach
  • You have to change code in a lot of places.
  • Violates the LoDC. Code for one concern is
    sending messages to code dealing with a different
    concern.

6
Example Logging (contd.)
  • Second Option
  • Define the logging code as an aspect.
  • Define join points from where the logging aspect
    needs to be called.
  • Benefits
  • You dont have to change any old code.
  • Its very easy to plug the logging code in and
    out of your application. Just add/remove the
    aspect.

7
AOP Tools
  • AspectJ allows a developer to define aspects and
    join points to use in concert with existing Java
    code.
  • Example
  • aspect Logging
  • pointcut find_Cwithdraw()
  • call( C.withdraw(..))
  • after find_Cwithdraw()
  • System.out.println(thisJoinPoint)

8
Critique
  • One main problem
  • Lack of concrete examples. Most of the
    information one can find on AOP immediately
    points to the logging example. This paper was no
    different.
  • If researchers in AOP want to have professional
    Software Engineers begin to use the technology,
    there probably going to have to come up with more
    concrete scenarios where AOP can be used for
    significant improvements in the development
    process.

9
Questions
  • What is Aspect Oriented Programming?
  • What is an example commonly used to explain the
    benefits of Aspect Oriented Programming?
  • What is one benefit of Aspect Oriented
    Programming?
Write a Comment
User Comments (0)
About PowerShow.com