26
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

Aspect-Oriented Software Development with Use Cases

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: 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

Page 2: Aspect-Oriented Software Development with Use Cases

More?

• http://www.early-aspects.net/

Page 3: Aspect-Oriented Software Development with Use Cases

Use Cases – Basic Ideas

• Overview

Page 4: Aspect-Oriented Software Development with Use Cases

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!

Page 5: Aspect-Oriented Software Development with Use Cases

Figure 3-1(incompletelist of use cases)

Figure 3-2(incompletelist of use caserealizationsfor the system)

Application Use Cases

:

Use case slices

Page 6: Aspect-Oriented Software Development with Use Cases

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. }

Page 7: Aspect-Oriented Software Development with Use Cases

Figure 4-3

Page 8: Aspect-Oriented Software Development with Use Cases

Extension

Figure 4-4

Figure 4-5

Page 9: Aspect-Oriented Software Development with Use Cases

Extension – con’t

Figure 6-1

Figure 6-3

Page 10: Aspect-Oriented Software Development with Use Cases

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

Page 11: Aspect-Oriented Software Development with Use Cases

Inclusion

Figure 6-6

Figure 6-8

Page 12: Aspect-Oriented Software Development with Use Cases

Generalization

Figure 6-9

Page 13: Aspect-Oriented Software Development with Use Cases

Application Use Cases and Infrastructure Use Cases - Example

Functionalreqs

Non-functionalreqs

Page 14: Aspect-Oriented Software Development with Use Cases

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

Page 15: Aspect-Oriented Software Development with Use Cases

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)

Page 16: Aspect-Oriented Software Development with Use Cases

Representing a Use Case Slice in “UML”

Page 17: Aspect-Oriented Software Development with Use Cases

Representing Aspects in “UML”

(MoreIn handout-Appendix A)

Page 18: Aspect-Oriented Software Development with Use Cases

Basic interaction diagram

Elaboratedinteraction diagramfor reservingroom

Example 1: use case slicefor room reservation

Page 19: Aspect-Oriented Software Development with Use Cases

Use Case SliceFor “Reserve Room”Use Case

Elaboratedinteraction diagramfor reservingroom

Example 1: use case slicefor room reservation

Page 20: Aspect-Oriented Software Development with Use Cases

Basic interaction diagram

Elaboratedinteraction diagramfor handling waiting list

Example 2: use case slicefor handle waiting list

Page 21: Aspect-Oriented Software Development with Use Cases

Elaboratedinteraction diagramfor handling waiting list

Use Case SliceFor “HandleWaiting List”Use Case

Page 22: Aspect-Oriented Software Development with Use Cases

Example: Infrastructure Use case slice forAdding authorization checks

Basic interaction diagram

Basic interactionDiagram extendedWith authorization calls

Use case slice for “Handle Authorization”

Page 23: Aspect-Oriented Software Development with Use Cases

For each use case slice,define corresponding classes and aspects.Form the system byputting together use case slices +non-use case slices (not shown)…

Page 24: Aspect-Oriented Software Development with Use Cases

Aspects and Architecture

Driving and Managing Architectural Decisions with Aspects, Garcia et al., 2006

Page 25: Aspect-Oriented Software Development with Use Cases

Aspects and Architecture

Driving and Managing Architectural Decisions with Aspects, Garcia et al., 2006

Page 26: Aspect-Oriented Software Development with Use Cases

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/