0% found this document useful (0 votes)
49 views20 pages

Aspect-Oriented Programming: Submitted To:-Submitted By

This document provides an introduction to aspect-oriented programming (AOP). It describes AOP as a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. The document defines key AOP terminology like join points, advice, pointcuts, and aspects. It also discusses where AOP can be useful, such as for implementing transaction management or custom aspects. While AOP complements object-oriented programming, the document concludes that AOP will likely be part of future programming paradigms rather than replace existing approaches.

Uploaded by

Sonu Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views20 pages

Aspect-Oriented Programming: Submitted To:-Submitted By

This document provides an introduction to aspect-oriented programming (AOP). It describes AOP as a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. The document defines key AOP terminology like join points, advice, pointcuts, and aspects. It also discusses where AOP can be useful, such as for implementing transaction management or custom aspects. While AOP complements object-oriented programming, the document concludes that AOP will likely be part of future programming paradigms rather than replace existing approaches.

Uploaded by

Sonu Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Aspect-Oriented

Programming

Submitted To:- Submitted By:-


Content
• Introduction
• What is AOP?
• History
• Terminology
• Why Use AOP?
• Where Use AOP?
• Will AOP replace OOP?
• Conclusion
Introduction
• Currently, the dominant programming
paradigm is object-oriented programming
that:

 has been presented as a technology that can fundamentally


aid software engineering.

 is reflected in the entire spectrum of current software


development methodologies and tools.

• Object orientation is a clever idea , but has


certain limitations.
Introduction
• A new programming technique called
aspect-oriented programming (AOP):

• makes it possible to clearly express those programs


that OOP fail to support.

• enables the modularization of crosscutting concerns


by supporting a new unit of software modularity-
aspects – that provide encapsulation for
crosscutting concerns.
What is AOP?
• It is a programming paradigm that aims to
increase modularity by allowing the separation
of cross-cutting concern.
• It is an approach to software development that
goes further in the direction of separation of
concerns.
• Separation of concerns is one of the most
important rules in software development.
• It states that the same concern should be solved
in a single unit of code. This is also called
Modularization.
History
• The term “Aspect-oriented programming ” came
into existence sometime between November of 1995
and may of 1996, at the Xerox Palo Alto Research
Center(PARC).
• Gregor Kiczales and colleagues at Xerox PARC
developed the explicit concept of AOP, and
followed this with the AspectJ AOP extension to
Java.
• IBM’s research team pursued a tool approach over a
language design approach and in proposed Hyper/J
and the concern Manipulation Environment, which
have not seen wide usage.
Terminology
• Crosscutting concern:-
It is a concern that
affect the whole application and should be centralized
in one location in code as possible, such as transaction
management, authentication, logging, security etc.

• Aspect:-
A modularization of a concern that cut
across multiple classes.
For example, a logging module would be called AOP
aspect for logging.
Terminology
• Join-point:-
It is a well-defined position in a
program, such as throwing an exception or invoking
a method.
• Advice:-
It is a class of functions that can
modify other functions. It is applied at a given join
point of a program.
Types of Advice
 Before Advice :- It executes before a join-point.

 After Returning Advice:- It executes after a


joint-point completes normally.

 After Throwing Advice:- It executes if method


exits by throwing an exception.
Types Of Advice
 After (finally) Advice:- It executes after a
join-point regardless of join point exit whether
normally or exceptional return.

 Around Advice:- It executes before and after


a join-point.
Terminology
• Point Cut:-
It is a general term for a set of joint
points whenever reached the corresponding advices
will be executed.

• Introduction:-
A feature that’s used to declare
additional methods and attributes for a particular
type.
Terminology
• Target object:-
The object being advised by
one or more aspects. This object will always be a
proxied object .It also referred to as the advised
object.
• AOP proxy:-
It is an object created by AOP
framework in order to implement the aspect contracts
(advise method execution and so on).
Terminology
• Weaving:-
It is the process in which an
aspect is added into an object. It can be executed in
the compiling time or during the running of the
program.

 Compile time:- Injecting the byte code of the


advice into the join-point during the compile
time is called compile time weaving.
 Class load time:-This injects the byte code at the
when the class is loaded. During this, the byte code
is injected into the loaded class to have the advice
code at the join-point.

 Run time:- Aspect are woven in sometime during


the execution of the application. An AOP container
will dynamically generate a proxy object that will
delegate to the target object while weaving in the
aspects.
Why Use AOP?
• AOP extends the traditional object-oriented
programming (OOP) model to improve code
reuse across different object hierarchies.

• The basic concept in AOP is an aspect which


is a common behavior that’s typically scattered
across method, classes , object hierarchies or
even entire object models.
Where Use AOP?
AOP is mostly used in the following cases:

• To provide declarative enterprise services


such as declarative transaction management.

• It allows users to implement custom aspects.


Will AOP replace OOP?
• Sure, it can and probably will add new standard
in the programming, but it will not replace
anything we use today.

• When OOP became the new standard in the


programming world, procedural/functional
programming did not disappear.

• They are a part of OOP, and so will OOP be in


AOP, it will constitute the base of AOP, just as
procedural is to OOP.
Will AOP replace OOP?
• AOP complements Object-oriented programming
by facilitating another type of modularity that
pulls together the prevalent implementation of a
crosscutting concern into a single unit.

• AOP is not the final answer to separation of


concerns, there will be new developments in this
area in the future, but it is likely that AOP will be a
part of these solutions, just as OOP is a part of
AOP.
Conclusion
• AOP introduces a new way of handling
crosscutting concerns, a problem hard to solve in
ordinary object-oriented programming.

• The problems with AOP today are the lack of


development tools and documentation/result of
other projects.

• It is hard to predict what AOP will become in the


future, but one thing is clear, AOP will be part of
future programming paradigms.
Thank You

You might also like