Upload
oren-spence
View
40
Download
1
Embed Size (px)
DESCRIPTION
Aspect-Oriented Software Development (AOSD) Tutorial #1. Course site : http://webcourse.cs.technion.ac.il/236608/Winter2007-2008/ T.A. :Emilia Katz [email protected] Reception hours: Sunday 17:00 – 18:00 Taub 641. - PowerPoint PPT Presentation
Citation preview
Aspect-Oriented Software Development (236608)
1
Aspect-Oriented Software Development (AOSD)
Tutorial #1
Course site : http://webcourse.cs.technion.ac.il/236608/Winter2007-2008/
T.A. : Emilia Katz
Reception hours: Sunday 17:00 – 18:00
Taub 641
Aspect-Oriented Software Development (236608)
2
Tutorial 1: Why aspects?
We will see:
• Example system
• Illustration of tangling and scattering
Aspect-Oriented Software Development (236608)
3
General Remarks
Facts about aspects:• Aspects can be identified at different stages of
the development cycle• Ideally: “Low impact (non-invasiveness) of
changes” Additive changes in requirements additive
change in design and code.• Tangling and scattering reduce reusability and
traceability, and changes become invasive
Aspect-Oriented Software Development (236608)
4
Example : SEESoftware Engineering Environment for
programs consisting of expressionsDescription:• Supports specification of expression
programs• Contains set of tools for expressions:
– evaluation– display– check (syntactic & semantic correctness)
Aspect-Oriented Software Development (236608)
5
Example : SEE – contd.
Development process (simplified):
Requirements (in natural language)
Design (UML)
Implementation (Java)
decompose by tool
decompose by object
Intuition: difference in decompositions causesscattering and tangling!
Aspect-Oriented Software Development (236608)
6
Design for SEE (partial)expression
number…
binary operator…
unary operator…
plus…
minus…
unary plus…
unary minus…
access/modify
apply tools
create() getters setters
eval() display() check()
Aspect-Oriented Software Development (236608)
7
New Requirements for SEE
• Persistence: expressions should be optionally persistent
• Style check support: it should be possible to check expressions against multiple styles (fonts, naming conventions, etc.)
Aspect-Oriented Software Development (236608)
8
Adding Persistenceexpression
number…
binary operator…
unary operator…
plus…
minus…
unary plus…
unary minus…
access/modify
apply tools
save
- retrieve persistent objects on first access
- flush modifications back to database
scattering
tangling
Aspect-Oriented Software Development (236608)
9
Adding Style Checksexpression
number…
binary operator…
unary operator…
plus…
minus…
unary plus…
unary minus…
access/modify
apply tools
let 3 style checkers be defined
visitor
ch. 1 ch. 2 ch. 3accept(visitor)
affect display() method
instead of check() method
Aspect-Oriented Software Development (236608)
10
Style Checks + Persistanceexpression
number…
binary operator…
unary operator…
plus…
minus…
unary plus…
unary minus…
access/modify
apply tools
save
persistence of style-checkers state information
accept(visitor)
visitor
ch. 1 ch. 2 ch. 3
Aspect-Oriented Software Development (236608)
11
Adding Persistence as Aspectexpression
number…
binary operator…
unary operator…
plus…
minus…
unary plus…
unary minus…
access/modify
apply tools
persistence asp.
pointcut definition
advice()
save() retrieve()
flush()
Aspect-Oriented Software Development (236608)
12
Crosscutting More than one Hierarchy
Example - system for exams in arithmeticInitially, includes exams: • Questions: each question is an expression• Answers: each answer is a number• Grade: grade is calculated based on answers
checks (use the “eval()” function of the questions, check equality with the answers, count correct answers percentage)
Addition: Persistency of the exams (the whole history)!
Aspect-Oriented Software Development (236608)
13
Adding Persistency - Results
Crosscutting more than one class hierarchy?
• Expressions (Questions)?
• Answers?
• Grades?
• Exam class?
Yes!
Crosscutting more than one class hierarchy!
✔
✔
✔
✔
Aspect-Oriented Software Development (236608)
14
Adding Persistency - Treatment
Without aspects – changes in: • Expressions (Questions)• Answers• Grades• Exam as a wholeWith aspects – Reuse persistency aspect, with changes in:• Pointcut definition [on what classes to be applied, …]• Additional aspect advice (may be unnecessary)