1960s - 70s
Mid/late 1990s
Java UML Unified Process Collaborative software process (open source)
jzavalar@yahoo.com
2
UML 2 UML 1.3, 1.4 UML 1.1 UML 1.0 UML 0.9
Other methods
Booch method
OMT
OOSE
jzavalar@yahoo.com
3 4
jzavalar@yahoo.com
Harel
Statecharts
Booch
Booch method
Rumbaugh
OMT
Embley
Singleton classes and high-level view
Jacobson
OOSE
Wirfs-Brock
Responsibilities
Shlaer - Mellor
Object lifecycles
Odell
Classification
jzavalar@yahoo.com
5 6
jzavalar@yahoo.com
Design View
Classes, interfaces, collaborations
Implementation View
Analysis
Analysis Model
Use cases
Components
Design Design Model Depl. Model
Implementation
Impl. Model
Active classes
Nodes
Test
Test Model
jzavalar@yahoo.com
jzavalar@yahoo.com
User requirements
Functional requirements
Object Diagrams Class Diagrams Component Diagrams Deployment Diagrams Sequence Diagrams Collaboration Diagrams Statechart Diagrams Activity Diagrams
Analysis Model
Design Model
Depl. Model
Impl. Model
Prototypes
Test Model
jzavalar@yahoo.com
10
jzavalar@yahoo.com
jzavalar@yahoo.com
Identify Movie
Customer
Open Account
Clerk
Return Movie
In-Store Customer
Telephone Customer
jzavalar@yahoo.com
13 14
jzavalar@yahoo.com
P r e c o n d ic i n S e c u e n c ia N o rm a l
Recommended: Booch, Rumbaugh, Jacobson: The Unified Modeling Language User Guide. Addison Wesley, 1999
P o s tc o n d ic i n E x cep cio n es
R e n d im ie n to
F r e c u e n c ia e s p e r a d a Im p o r t a n c ia U rg en cia C o m e n t a r io s
jzavalar@yahoo.com
15 16
jzavalar@yahoo.com
Use Case 1
Specifies the intended behavior (the what?) of a system. Is a set of sequences of actions (including variants) to yield an observable result of value to an actor. Represents a functional requirement of the system as a whole. It IS NOT a flow chart
Use Case 2 Each sequence (also called a scenario) represents the interaction of things outside the system (its actors) with the system itself (or parts of the system). Separate main vs. alternative flows
Use case
Process loan Loan Officer
Used to: describe customer requirements (early analysis). Validate your architecture / verify your system.
jzavalar@yahoo.com
17
Actor
jzavalar@yahoo.com
18
- interaction diagrams
jzavalar@yahoo.com
20
Actors
Role that a human/hardware device/ another system plays with respect to the system Actors carry out use cases
- look for actors, then their use cases
Actors
Actors can be specialized
specialization relationship
Actors do not need to be humans! Actors can get value from the use case (Client in example) or participate in it (Financial Officer in example)
connected to use cases only by association association = communication relationship (both can send messages to, or receive messages from the other one)
jzavalar@yahoo.com
22
jzavalar@yahoo.com
21
child use case inherits behavior and meaning of the parent use case child may add or override the parents behavior
Validate client
Includes interactions with actor(s), and describes what objects are exchanged May contain extension points Clear, precise, short descriptions
Check password
Retinal scan
jzavalar@yahoo.com
23 24
jzavalar@yahoo.com
Include Example
Use Case: Track order Precondition: Financial Officer is logged in Main flow:
1. Obtain and verify order number 2. Include (Validate client) 3. For each part in the order,
Place order
<<include>>
Validate client
Track order
jzavalar@yahoo.com
25 26
jzavalar@yahoo.com
Extend Example
Use Case: Place order Precondition: Financial Officer is logged in Main flow:
1. 2. Collect the clients order items 3. (set priority) 4. Submit order for processing
Allows to model conditional subflows Allows to insert subflows at a certain point, governed by actor interaction extension points (in textual event flows)
jzavalar@yahoo.com
27 28
jzavalar@yahoo.com
Comparing extends/includes
Different intent
- extend
to distinguish variants associated actors perform use case and all extensions actor is linked to base case
- include
to extract common behavior often no actor associated with the common use case different actors for caller use cases possible
jzavalar@yahoo.com
29 30
jzavalar@yahoo.com
Includes
Customer
Trader
Sales person
Stereotype
Extends
Clerk Check In Movie
jzavalar@yahoo.com
31 32
jzavalar@yahoo.com
Recipe / Tasks to do
Identify actors that interact with the system Organize actors Consider primary ways of interaction with actors Consider exceptional ways Organize behaviors as use cases, using generalize/include/extend relationships Describe what actors require from system, not what goes on in the system!
jzavalar@yahoo.com
33 34
jzavalar@yahoo.com
The End
First Trying
jzavalar@yahoo.com
37 38
jzavalar@yahoo.com
jzavalar@yahoo.com
39 40
jzavalar@yahoo.com
System
jzavalar@yahoo.com
41 42
jzavalar@yahoo.com
system
functions as use cases, e.g. date, age, database relations not named
jzavalar@yahoo.com
43 44
jzavalar@yahoo.com
Use Case 1
Use Case: Query weather&snow forecast Precond: Main flow:
1. Visitor enters date 2. Weather & snow forecast for local region is displayed for specified date
Visitor
Book SB course
jzavalar@yahoo.com
45 46
jzavalar@yahoo.com
Use Case 2
Use Case: Book SB course Precond: Main flow:
1. 2. 3. 4. 5. Visitor enters date Include (Enter personal info) (Enter kids age) Store reservation Confirm reservation to Visitor
Use Case 3
Use Case: Book kids SB course Precond: SB course is for a kid Main flow:
1. 2. 3. Enter kids age Store reservation Confirm reservation to Visitor
Exceptional flow:
If course for specified date is adult course, then tell visitor so and let him choose another date.
Exceptional flow:
If number of course participants for specified date > 8, then tell visitor so and let him choose another date
Exceptional flow:
If course for specified date is kids course, and the specified age is outside the courses age range, then tell visitor so and let him choose another date.
jzavalar@yahoo.com
47 48
jzavalar@yahoo.com
Title: The unified modeling language user guide Authors: G. Booch, J. Rumbaugh, I Jacobson Publisher: Addison Wesley Publication year: 1998 Title: Software engineering in the Internet age Authors: F. Maurer, G. Kaiser Publisher: IEEE Publication year: 1998 Journal: IEEE Internet Computing Magazine Volume: 2 Issue: 5
Small exercise: Draw a Use Case Diagram (at least two use cases) Describe use cases (at least one)
Remove reference
List references
jzavalar@yahoo.com
49 50
jzavalar@yahoo.com
jzavalar@yahoo.com
51 52
jzavalar@yahoo.com
Add reference
Add journal paper: If the paper is a journal, then the system additionally asks for the journals name, the volume number and the issue number.
jzavalar@yahoo.com
53
jzavalar@yahoo.com
55 56
jzavalar@yahoo.com
jzavalar@yahoo.com
57 58
jzavalar@yahoo.com
jzavalar@yahoo.com
59 60
jzavalar@yahoo.com
10
Good solution 1
<<extend>> (print receipt) withdraw <<include>> check balance User <<include>> <<include>> withdraw with receipt
Verify user
deposit
jzavalar@yahoo.com
61 62
jzavalar@yahoo.com
Good solution 2
Use case: withdraw Precondition: User has selected withdraw option Main flow: Include (Verify user) Prompt user for amount to withdraw Check available funds of user Check available money of ATM Remove amount from account Give money (print receipt) Print current balance Exceptional flow If not sufficient funds or money available, prompt user for lower amount
63
Good solution 3
Use case: deposit Precondition: User has selected deposit option Main flow: Include (Verify user) Prompt user for amount of deposit Open slot Get check (print receipt) Print (balance + deposited amount)
jzavalar@yahoo.com
64
jzavalar@yahoo.com
Good solution 4
Use case: check balance Precondition: User has selected balance option Main flow: Include (Verify user) Print balance
jzavalar@yahoo.com
11
Acceptable solution 1
<<extend>> (print receipt) withdraw
Use case: deposit with receipt Precondition: User has selected deposit option and print receipt option ...
deposit <<extend>> (print receipt) deposit with receipt
jzavalar@yahoo.com
67 68
jzavalar@yahoo.com
Acceptable solution 2
Use case: withdraw Precondition: User is verified and has selected withdraw option
The End
jzavalar@yahoo.com
69
12