Docstoc

System Sequence Diagrams and Sequence Diagrams - Welcome to

Document Sample
System Sequence Diagrams and Sequence Diagrams - Welcome to Powered By Docstoc
					                 System Sequence Diagrams
1 Introduction
• A system sequence diagram (SSD) is a fast and easily created
   artifact that illustrates input and output events related to the
   systems under discussion. They are input to operation contracts
   and, most importantly, object design.
• We can relate SSDs to the other models we have seen so far




                                                                      1
SSDs within the
UP




              2
2 Examples




             3
• An SSD shows, for a particular course of events within a use
  case, the external actors that interact directly with the system,
  the system (as a black box), and the system events that the actors
  generate. Time proceeds downward, and the ordering of events
  should follow their order in the scenario.
• In use cases, actors generate system events requesting some
  system operations to handle the events.
• We can draw an SSD for a main success scenario of each use
  case, and frequent or complex alternative scenarios.
• SSDs help to validate, clarify and refine use cases.




                                                                   4
5
• Interaction frames are used to show loops (and other constructs)
  in sequence diagrams; common interaction frames operators
  include:
   – alt : Alternative multiple fragments; only the one whose condition is true
     will execute;
   – opt : Optional; the fragment executes only if the supplied condition is
     true.
   – loop : The fragment may execute multiple times, and the guard indicates
     the basis of iteration.




                                                                                  6
Illustrating Various Interaction Frames
                                          7
3 Relationship Between SSDs and Use Cases




                                            8
4 Conclusions on System Sequence Diagrams
• Don't create SSDs for all scenarios, rather draw them only for
   the scenarios chosen for the next iteration. And, they shouldn't
   take long to sketch, perhaps a few minutes or a half hour.
• SSDs are also very useful when you want to understand the
   interface and collaborations of existing systems, or to document
   the overall architecture of the application.
• SSDs represent visually the essential aspects of a use case.
• For each event that the system receives from an actor, the
   system is expected to implement an operation, of the same
   name, to perform something of value to the actors.




                                                                      9
5 Sequence Diagrams for Design
• Whilst SSDs use sequence diagrams to illustrate
   communications between actors and the system (define the
   public interface of the system: high level analysis), sequence
   diagrams are also used to show interactions between objects
   (define algorithms: low level design)
• For example:
                                         public class A
                                         {
                                         private B myB = new B();
                                           public void doOne()
                                           {
                                                myB.doTwo();
                                                myB.doThree();
                                           }
                                         // …
                                         }

                                                                    10
• Creation of instances :
   – Typically we use the language independent create message:




                                                                 11
Iteration Over a Collection Using Implicit Notation




                                                      12

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:7
posted:9/3/2012
language:English
pages:12