Sequence Diagrams October 16, 2007 1 Digging deeper... Examine - - PowerPoint PPT Presentation

sequence diagrams
SMART_READER_LITE
LIVE PREVIEW

Sequence Diagrams October 16, 2007 1 Digging deeper... Examine - - PowerPoint PPT Presentation

Sequence Diagrams October 16, 2007 1 Digging deeper... Examine interesting methods. What information do they need? Where does that information come from? What objects do they need to interact with? What methods do they need to call? 2


slide-1
SLIDE 1

Sequence Diagrams

October 16, 2007

Digging deeper...

Examine interesting methods. What information do they need? Where does that information come from? What objects do they need to interact with? What methods do they need to call?

1 2 Wednesday, October 17, 2007

slide-2
SLIDE 2

Method execution Objects

Sequence Diagram Notation

:Postcard :Graphics

paintComponent setColor fillRect

Time Method calls Object Name Object Creation

Constructing Objects

:RectangleButton :Rectangle

actionPerformed add

canvas:JComponent 3 4 Wednesday, October 17, 2007

slide-3
SLIDE 3

Returning a value Passing a parameter Calling a method on “this”

Returning Values

:DensePolynomial

subtract(q) minus

q:Polynomial

minusQ add(minusQ)

Conditionals & Loops

UML 2 allows documenting conditionals and loops BUT, diagrams quickly become complicated and less useful Recommendation: Use a sequence diagram to document a particular situation, not model all control flow at once Put a note in your diagram describing its assumptions

5 6 Wednesday, October 17, 2007

slide-4
SLIDE 4

Limiting Sequence Diagrams

:DensePolynomial

subtract(q) minus

q:Polynomial

minusQ add(minusQ) isZero

:DensePolynomial

setTerm setTerm

Subtracting a non-zero polynomial with 2 terms. 7 Wednesday, October 17, 2007