1
System Sequence Diagrams and Contracts
Eunjee Song SSDs and Contracts-1
and Contracts
Eunjee Song Computer Science Department Baylor University
Specifying required behavior using the UML
Class models describe objects and their
relationships
Behavior can be specified in terms of operation
pre and postconditions, but behavior is not the primary focus of a class model
Eunjee Song SSDs and Contracts2
primary focus of a class model
Behavioral models at the requirements
level
Interaction models: describe interactions
between actors and the system
Contracts: Specify operations invoked by
actors.
Still doing... Requirements Analysis
Focusing on the WHAT not the HOW System sequence diagrams and how
they relate to use cases
Eunjee Song SSDs and Contracts3
S ale d a te . . . S a le s L in e Ite m q u a ntity 1 ..* 1 . . . . . . D o m ain M od e l U se -C a s e M o d el R e q uire - m e n ts B u s in e s s M o d e lin g S a m p le U P A rtifac t R elatio ns h ip s : S y s te m U se C a se T e xt system e ve n ts
C a shie r P roce ss S aleuse ca se n a m e s U se C a se D ia gram V isio n G lo ssa ry p a ra m eters an d re tu rn va lue d e ta ils P ro ce ss S a le 1 . C u sto m e r a rrive s ... 2 . C a sh ie r m a ke s ne w sa le . 3 . ...
Eunjee Song SSDs and Contracts4
O p e ra tio n: en te rIte m (… ) P o st-con d itio n s:
- . . .
O p e ra tio n C o n tra c ts D e sign M o d e l : R e g ister e n te rIte m (ite m ID , q u a n tity) : P ro d u ctC atalog sp e c = g e tP ro d u ctS p e c ( item ID ) a dd L in e Ite m ( sp e c, q u a n tity ) : S a le D e s ig n : S y s te m en te rIte m (id , qu a n tity ) S y s te m S e q ue n c e D ia g ra m s m ak e N e w S a le ()
: C ash iersyste m
- p eratio ns
S u pp le m e n ta ry S p e cificatio n sta rtin g e ven ts to d e sig n fo r
System Sequence diagrams
Describes in more detail a scenario in a
use case
Created from the text of the use case
A kind of UML sequence diagram
Eunjee Song SSDs and Contracts5
SSD is a simplified version of SD
useful for requirements analysis
More general version of sequence diagrams:
later, when talking about design
Example: Process Sale for POS system
SSD Example
enterItem(itemID quantity) :System : Cashier a UML loop interaction external actor to system Process Sale Scenario system as black box the name could be "NextGenPOS" but "System" keeps it simple the ":" and underline imply an instance, and are explained in a later chapter on sequence diagram notation in the UML makeNewSale [ more items ] loop
Eunjee Song SSDs and Contracts6
enterItem(itemID, quantity) endSale makePayment(amount) interaction frame, with a boolean guard expression a message with parameters it is an abstraction representing the system event of entering the payment data by some mechanism description, total return value(s) associated with the previous message an abstraction that ignores presentation and medium the return line is
- ptional if nothing is
returned total with taxes change due, receipt