Aspect Oriented Software Development - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Aspect Oriented Software Development

Description:

A program abstraction that defines a cross-cutting concern. ... design patterns. object-oriented frameworks such as J2EE and .NET, and more ... – PowerPoint PPT presentation

Number of Views:775
Avg rating:3.0/5.0
Slides: 28
Provided by: ieeegol4
Category:

less

Transcript and Presenter's Notes

Title: Aspect Oriented Software Development


1
Aspect Oriented Software Development
  • By Mostafa El Barbary

2
On July 20th 2008, our name has changed from
to
3
Objectives
  • To explain the principle of separation of
    concerns in software development
  • To introduce the fundamental ideas underlying
    aspect-oriented development
  • To show how an aspect-oriented approach can be
    used at all stages of development

4
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

5
Introduction
  • A concern is an area of interest or focus in a
    system. Concerns are the primary criteria for
    decomposing software into smaller, more
    manageable and comprehensible parts that have
    meaning to a software engineer.
  • Object-oriented programming, describing concerns
    as objects
  • Procedural programming, describing concerns as
    procedures

6
Introduction
  • Separation of concerns (SOC) The principle of
    separation of concerns states that software
    should be organized so that each program element
    does one thing and one thing only.
  • Each program element should therefore be
    understandable without reference to other
    elements.
  • Object-oriented programming languages such as
    Java can separate concerns into objects.
  • Service-oriented architecture can separate
    concerns into services.
  • Procedural programming languages such as C and
    Pascal can separate concerns into procedures.

7
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

8
Problem Statement
void transfer(Account fromAccount, Account
toAccount, int amount) if
(fromAccount.getBalance() lt amount)
throw new InsufficientFundsException()
fromAccount.withdraw(amount)
toAccount.deposit(amount)
9
Problem Statement
void transfer(Account fromAccount, Account
toAccount, int amount) throws Exception
if (!getCurrentUser().canPerform(OP_TRANSFER))
throw new SecurityException()
Transaction tx database.newTransaction()
try if (fromAccount.getBalance() lt
amount) throw new InsufficientFundsExc
eption() fromAccount.withdraw(amoun
t) toAccount.deposit(amount)
tx.commit() systemLog.logOperation(
OP_TRANSFER, fromAccount, toAccount, amount)
catch(Exception e)
tx.rollback() throw e
Authentication Concern
Transaction Concern
Transaction Concern
Logging Concern
Transaction Concern
10
Problem Statement
Transfer Concern
Authentication Concern
Logging Concern
Transaction Concern
11
Problem Statement
Banking System
Transfer Concern
Cash Deposit Concern
Authentication Concern
Authentication Concern
Logging Concern
Logging Concern
Transaction Concern
Transaction Concern
Cash Withdrawal Concern
Authentication Concern
Logging Concern
Transaction Concern
12
Problem Statement
  • Code is scattered when one concern (like logging)
    is spread over a number of modules (e.g.,
    Transfer method).
  • Modules end up tangled with multiple concerns
    (e.g., Transfer, logging, and Authentication).

13
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

14
Aspect Solution
  • AOSD attempts to solve this problem by allowing
    the programmer to express cross-cutting concerns
    (e.g., Transaction, logging, and Authentication)
    in stand-alone modules called aspects.
  • Used in conjunction with other approaches -
    normally object-oriented software engineering.
  • Aspects encapsulate functionality that cross-cuts
    and co-exists with other functionality.
  • Aspects include a definition of where they should
    be included in a program as well as code
    implementing the cross-cutting concern.

15
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

16
Aspect Anatomy
aspect authentication //this is the
aspect before call (public void Transfer
(..)) // this is a pointcut // this is
the advice int tries 0 string
userPassword Password.Get ( tries ) while
(tries lt 3 userPassword ! thisUser.password (
) ) // allow 3 tries to get the password
right tries tries 1 userPassword
Password.Get ( tries ) if (userPassword
! thisUser.password ( )) then //if password
wrong, assume user has forgotten to
logout System.Logout (thisUser.uid) //
authentication
17
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

18
Aspect Terminology
19
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

20
Aspect Weaving
  • Aspect weavers process source code and weave the
    aspects into the program at the specified
    pointcuts.

21
Aspect Weaving
22
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

23
Evolution of Systems Development Methods
24
Agenda
  • Introduction
  • Problem Statement
  • Aspect Solution
  • Aspect Anatomy
  • Aspect Terminology
  • Aspect Weaving
  • Evolution of Systems Development Methods
  • Aspect Oriented Software Development

25
Aspect Oriented Software Development
  • A holistic approach to developing software
    systems with aspects.
  • Better modularity for functional requirements,
    nonfunctional requirements, platform specifics,
    and so on and keeping them separate from each
    other.
  • AOSD is not just AOP. It encompasses a whole
    range of techniques to help you achieve better
    modularity.
  • object orientation
  • component-based development
  • design patterns
  • object-oriented frameworks such as J2EE and .NET,
    and more

26
Aspect Oriented Software Development
... Requirements Engineering
... Architecture
... Design
Aspect-oriented...
... Programming
... Verification techniques
27
QA
28
  • Mostafa Elbarbary
  • 012-428-6547
  • Mostafa.elbarbary_at_its.ws

29
Thank You
Write a Comment
User Comments (0)
About PowerShow.com