Aspect Oriented Programming
Aspect Oriented Programming
PROGRAMMING (AOP)
GROUP 5
• Aspect oriented programming (AOP) is one of the key components
of Spring Framework. Aspect-Oriented Programming has been around
in other programming languages for quite some time now and
sophisticated solutions taking advantage of AOP exist. It is
a programming paradigm that aims to increase modularity by allowing
the separation of cross-cutting concerns.
• Aspect-oriented programming entails breaking down program logic into
distinct parts (so-called concerns, cohesive areas of functionality). Nearly
all programming paradigms support some level of grouping
and encapsulation of concerns into separate, independent entities by
providing abstractions (e.g., functions, procedures, modules, classes,
methods) that can be used for implementing, abstracting and composing
these concerns. Some concerns "cut across" multiple abstractions in a
program, and defy these forms of implementation. These concerns are
called cross-cutting concerns or horizontal concerns
AOP Terminologies
• Aspect
This represents a point in your application where you can plug-in the
AOP aspect. You can also say, it is the actual place in the application
where an action will be taken using Spring AOP framework.
• Advice
A before advice is executed before the target method is being called, but cannot prevent
An after returning advice is executed after returning from the target method. The result of
the target method invocation is available to the after returning advice, but it can’t change
it. If the target method throws an exception, the after returning advice is not executed.
• After throwing advice
• After advice
An after advice is executed after the target method has been called, no
matter if an exception was thrown or not.
• Around advice
An around advice is wrapped around the execution of the target method. It may
execute code before and after the invocation of the target method and may
ultimately prevent the original method from being executed at all. An around
advice is also responsible for calling other around advices at the same join point
and returning either the original or a modified result for the target method.
• Advice chain
If more than one around advice exists for a join point, they are called in an
onion-like advice chain: The first around advice probably executes some before-
code, then calls the second around advice which calls the target method. The
target method returns a result which can be modified by the second around
advice, is returned to the first around advice which finally returns the result to
the initiator of the method call. Any around advice may decide to proceed or
• ActionScript
• Ada
• AutoHotkey]
• The Cocoa Objective-C frameworks
• ColdFusion
• Common Lisp
• Delphi
• Delphi Prism
• Emacs Lisp
• Groovy
• Haskell
• Java
• C/ C++
• COBOL
• JavaScript
• Logtalk
• Lua
• make
• Matlab
• ML
• Perl
• PHP
• Prolog
• Python
• Racket
• Ruby
• Squeak Smalltalk
• UML 2.0
• XML