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 Wednesday, October 17, 2007
Sequence Diagram Notation Objects :Postcard :Graphics paintComponent setColor fillRect Time Method execution Method calls 3 Constructing Objects :RectangleButton canvas:JComponent actionPerformed :Rectangle add Object Name Object Creation 4 Wednesday, October 17, 2007
Returning Values :DensePolynomial q:Polynomial subtract(q) minus minusQ add(minusQ) Returning a value Calling a method on Passing a parameter “this” 5 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 6 Wednesday, October 17, 2007
Limiting Sequence Diagrams :DensePolynomial q:Polynomial subtract(q) minus isZero :DensePolynomial setTerm setTerm minusQ add(minusQ) Subtracting a non-zero polynomial with 2 terms. 7 Wednesday, October 17, 2007
Recommend
More recommend