Aspect-Oriented Software Development with Use Cases
-
Upload
wwwmyassignmenthelpnet -
Category
Education
-
view
123 -
download
4
description
Transcript of Aspect-Oriented Software Development with Use Cases
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
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(incompletelist of use cases)
Figure 3-2(incompletelist of use caserealizationsfor the system)
Application Use Cases
:
Use case slices
From Use Cases to AspectsFigure 1-2
Figure 2-1
1. public aspect CheckInCustomer {2. ...3. public void Room.assignCustomer ()4. {5. // code to check in customer6. }7. public void Reservation.consume()8. {9. // code to consume reservation10. }11. public void Payment.createBill()12. {13. // code to generate an initial outstanding bill14. }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
Functionalreqs
Non-functionalreqs
Application Use Cases and Infrastructure Use Cases – Example – con’t
Relationship between applicationuse cases and infrastructure usecase? “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 SliceFig 13-3,12-3,12-7, 13-4, 13-6(Jacobson & Ng)– Example of an Infrastructure Use Case SliceFig 14-4,14-5;14-9 (Jacobson & Ng)
Representing a Use Case Slice in “UML”
Representing Aspects in “UML”
(MoreIn handout-Appendix A)
Basic interaction diagram
Elaboratedinteraction diagramfor reservingroom
Example 1: use case slicefor room reservation
Use Case SliceFor “Reserve Room”Use Case
Elaboratedinteraction diagramfor reservingroom
Example 1: use case slicefor room reservation
Basic interaction diagram
Elaboratedinteraction diagramfor handling waiting list
Example 2: use case slicefor handle waiting list
Elaboratedinteraction diagramfor handling waiting list
Use Case SliceFor “HandleWaiting List”Use Case
Example: Infrastructure Use case slice forAdding authorization checks
Basic interaction diagram
Basic interactionDiagram extendedWith authorization calls
Use case slice for “Handle Authorization”
For each use case slice,define corresponding classes and aspects.Form the system byputting 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/