Aspect-Oriented Software Development with Use Cases
959 views
26 slides
Aug 06, 2014
Slide 1 of 26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
About This Presentation
want to learn about Aspect-Oriented Software Development with Use Cases. These ppts will help you . Still need more info or help with any assignment related to use case visit http://www.myassignmenthelp.net/uml-assignment-help.php
Size: 900.18 KB
Language: en
Added: Aug 06, 2014
Slides: 26 pages
Slide Content
Aspect-Oriented Software
Development with Use Cases
AspectJ Reference:
Diagrams and materials based on “Aspect-Oriented
Software Development with Use Cases” by I.
Jacobson and P.-W. Ng, 2005, Addison-Wesley
More?
•http://www.early-aspects.net/
Use Cases – Basic Ideas
•Overview
Use Cases & Aspects
•So far, our aspects have been about non-
functional concerns
•Observations:
–a use case usually refers to a function that a user
does with the system; usually a set of use cases
model functional requirements (application use cases)
–use cases can also be used to model non-functional
requirements (infrastructure use cases)
–a use case is a user task or a concern
–a use case (whether application or infrastructure)
could correspond to an aspect!
Figure 3-1
(incomplete
list of
use cases)
Figure 3-2
(incomplete
list of
use case
realizations
for the
system)
Application Use Cases
:
Use case slices
From Use Cases to Aspects
Figure 1-2
Figure 2-1
1. public aspect CheckInCustomer {
2. ...
3. public void Room.assignCustomer ()
4. {
5. // code to check in customer
6. }
7. public void Reservation.consume()
8. {
9. // code to consume reservation
10. }
11. public void Payment.createBill()
12. {
13. // code to generate an initial outstanding bill
14. }
15. ...
16. }
Figure 4-3
Extension
Figure 4-4
Figure 4-5
Extension – con’t
Figure 6-1
Figure 6-3
Use Case: Handle Waiting List
Basic Flows
. . .
Extension Flows
EF1.Queue For Room
This extension flow occurs after UpdatingRoomAvailability yields No Rooms Available.
The system creates a pending reservation with a unique identifier for the selected Room type.
The system puts the pending reservation into a waiting list.
The system displays the unique identifier of the pending reservation to the customer.
The base use case terminates.
Extension Pointcuts
extension pointcut UpdatingRoomAvailability = Reserve Room.Update Room AvailabilityFigure 6-5
Inclusion
Figure 6-6
Figure 6-8
Generalization
Figure 6-9
Application Use Cases and Infrastructure Use
Cases - Example
Functional
reqs
Non-functional
reqs
Application Use Cases and Infrastructure Use
Cases – Example – con’t
Relationship between application
use cases and infrastructure use
case? “binding”
e.g., “<Perform Transaction>” binds to
“Reserve Room” &
“<Actor>” binds to “Customer”
Note: a template
Use Case Slice
•A use case slice is collects together the parts of classes and
operations (as represented via aspects), and (whole) classes, that
are specific to a use case.
•What follows?
–Example of 2 Application Use Cases and their Use Case Slice
Fig 13-3,12-3,12-7, 13-4, 13-6
(Jacobson & Ng)
–Example of an Infrastructure Use Case Slice
Fig 14-4,14-5;14-9
(Jacobson & Ng)
Representing a Use Case Slice in
“UML”
Representing Aspects in “UML”
(More
In handout-
Appendix A)
Basic interaction diagram
Elaborated
interaction
diagram
for reserving
room
Example 1: use case slice
for room reservation
Use Case Slice
For “Reserve Room”
Use Case
Elaborated
interaction
diagram
for reserving
room
Example 1: use case slice
for room reservation
Basic interaction diagram
Elaborated
interaction
diagram
for handling waiting list
Example 2: use case slice
for handle waiting list
Elaborated
interaction
diagram
for handling waiting list
Use Case Slice
For “Handle
Waiting List”
Use Case
Example: Infrastructure Use case slice for
Adding authorization checks
Basic interaction diagram
Basic interaction
Diagram extended
With authorization calls
Use case slice for “Handle Authorization”
For each use case slice,
define corresponding
classes and aspects.
Form the system by
putting together use case slices +
non-use case slices (not shown)…
Aspects and Architecture
Driving and Managing Architectural Decisions with Aspects, Garcia et al., 2006
Aspects and Architecture
Driving and Managing Architectural Decisions with Aspects, Garcia et al., 2006
Aspects and Software Product
Lines
•There are kernel, optional, variant features
in products
•“Extensions” can be modelled and
implemented via aspects – variations
localised in aspects
•On-going: e.g., http://ample.holos.pt/,
http://www.softeng.ox.ac.uk/aople/