[Skip Navigation] [ CSUSB ] / [CNS] / [Comp Sci & Engineering] / [R J Botting] / [CS375] [Search ]
[About] [Contact] [Grades] [Objectives] [Patterns] [Projects] [Question] [Schedule] [Syllabus]
Session: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]
[Text Version] 08.html Mon Sep 28 15:44:24 PDT 2009

Contents


    CSci 375/08 SSDs


    Table
    Date #Topic (Participation 2pt)Study pages (2 pts)Quiz(15 pts)Project Work(10 pts)
    Previous 7Domain Model II157-171Q3(121-171)-
    Today 8SSDs173-196-W3(Domain Model 1)
    Next 9Packages197-219Q4(173-219)-

    (Close Table)

    Revision History


    Table
    Version# DateDescriptionAuthor
    0 2005-01-03Used boiler plate to make templateRJB
    1 2005-01-31Input section headingsRJB
    2 2005-02-07Adding QuestionsRJB
    3 2006-01-12Update to 2006RJB
    4 2007-01-10Add link to projectRJB
    5 2007-02-07Added notes on format of messagesRJB
    6 2008-02-07Added notes on SSDs and testing in C++RJB
    7 2009-03-18Added instructions on writing messagesRJB

    (Close Table)

    10 SSDs

      Introduction

    1. SSD::="System Sequence Diagram", a way of using the UML to model the sequences of events flowing between actors and the system under development.

      SSD's clarify the steps in use cases and prepares you to design collections of objects that realize a use case.

      Each SSD should show a scenario with one event/response for each interaction between an actor and the system. These events should be thought of as coming from the user interface into the heart of the software. We will work out what happens inside this next week.

      We will use sequence diagrams with similar form but more objects to design our software. The messages in the SSD will be the incoming "found" messages that we will use to work out how objects in our program will "collaborate" to give the response that the user/stakeholders require.

      It shows a single box(object) for the whole system. It does not show any internals of the system. It is a black box model of the system.

      Example of a SSD

      Messages

      Messages turn up a lot in OO programs: in SSD, interaction diagrams, and in design class diagrams.

      You should use a strict syntax for messages in UML diagrams.

       		login(id,password)
       		logout()
       		findClassesWith(name)
       		registerIn(me, class)
       		pick(itemNumber)
       		createMailMessage(subject, replyTo, message, signature)
      You aim to be a precise as possible. The idea is to uncover the details that can kill a project, not slide them underneath a rug.

      Here is the syntax of function calls:

    2. message::= name "(" data ")". The parentheses are important. Do not omit them.

    3. data::= empty | identifier | identifier "," identifier "," .... The data is empty, or an identifier, or a list of identifiers. (You can also specify a class of object like this identifier : className).

    4. name::= event | request_for_action_by_target. You should choose short neames that either tell the reader the reason that the message was sent or it is an instruction to the target object to do something.
       		timeOut
       		create
       		playSelectionFromList

    5. empty::="", indicates that the message has no data -- typically one of a small number of events like clicking the logout button.

    6. identifier::=lowerCaseWord # UppercaseWord, the data in a message either is an element like a number, character, or string. It can also identify an objectt. You send an object in a message so thatt the receiving object can do things to it ... like send back a response or extract more data.

      Put messages on an arrow with a filled in head.

      Distinguish messages from the object returned in response to messages. These are just objects. They are data. They have no name and they list the data that is sent back in response to a message:

       		confirmRegistration
       		listOfClasses
       		OK
       		MessageOfTheDay
       		acknowledgement
      These are put on dashed arrows with an open "stick" arrowhead.

      Note -- omit responses that merely say that the message has been handled! KISS!

      Purpose of SSDs

    7. * Purpose: Given some use cases, refine some their scenarios.
    8. * Prepare to design objects to handle use cases.

      Text -- chapter 10

    9. * Fig 10.1 Artifact influences
    10. * 10.1 Example: NextGen SSD
    11. ** 10.2 Definition of SSD
    12. *** 10.3 Motivation: why draw a SSD
    13. *** 10.4 Using the UML to draw a SSD: operation calls, operation data, returned values.
    14. +++++ Get the arrowheads right!
    15. * 10.5 Relation between Use cases and SSD: one scenario per SSD.
    16. *** 10.6 Naming events: See Messages above. Keep them "essential" -- express the intent not the actual physical action by the user.
    17. ** 10.7 Collaborations with other systems
    18. 10.8 SSD -> Glossary?
    19. 10.9 Example: Monopoly SSD
    20. ++ Exercise: why do I give this SSD a B grade rather than an A?
    21. * 10.10 Process: Iterative, Evolutionary. Mainly during elaboration.
    22. 10.11 History. I knew Derek Coleman and have the Fusion book in my office... you can forget this:-(

      SSDs and C++ Testing

      You can quickly create a main program that will test your design directly from the SSD becasue testing doesn't have a complex User Interface.

      For example the SSD above would lead to a C++ main Program like this

       ...
       #include <WhereTheClassesAreDeclared.h>
       int main()
       {
       	SomeClass * testObject = new SomeClass(someValues);
       	testObject->event();
       	someType response = testObject->event2(data);
       	assert ( someProperty(response) );
       }
      However.... you don't know what "SomeClass" will be until you've designed the internal interactions. See [ 10.html ] later.

    . . . . . . . . . ( end of section SSDs) <<Contents | End>>

    11 Operation Contracts

    1. * Work out how operations in the SSD effect the system as a whole.
    2. ** Complex systems only!

    3. Artifact influences
    4. ** 11.1 Contract: operation, cross ref, preconditions, postconditions
    5. * Example: enterItem
    6. * 11.2 Sections in an operation contract
         .Open Contract name
         . Operation message(argument2)
         . Preconditions
         . Postconditions
         .Close


      * 11.3 What is a System Operation.
    7. * 11.4 Post Conditions
    8. ** 11.5 Example
    9. * 11.6 Update the Domain model?
    10. ** 11.7 Guideline: When to use: only complicated steps in complicated systems.
    11. * 11.8 Guideline: How to do it
    12. ** 11.9 Examples from NextGen
    13. 11.10 Example from monopoly
    14. 11.11 UML contacts? May to use the Object Constraint Language? Or Logic
    15. OCL::="Object Constraint Language", [ ../samples/ocl.html ] for more details.
    16. Example OCL FYI
           	context FamilyTree::birth(f:Person, m:Person, bday:Date)
           		post: self.father=f and self.mother=m
           			and self.birthday = bday.

    17. ++ I cover many ways to express, check, and process logic in my Formal Methods elective courses. [ ../cs556/ ]
    18. 11.12 Process
    19. 11.13 History
    20. 11.14 Resources

    . . . . . . . . . ( end of section Operation Contracts) <<Contents | End>>

    Requirements to Design

    1. * Introduction
    2. ** 12.1 Do the right thing, do the thing right
    3. *** 12.2 Provoke changes early!
    4. 12.3 How long did that take?

    . . . . . . . . . ( end of section Requirements to Design) <<Contents | End>>

    Another example SSD -- Use Case: Teacher posts grades


    1. Teacher logs in.
    2. Teacher selects a course.
    3. Teacher posts the grades for that course.
    4. Teacher checks the student IDs for that course.
    5. (repeat above three steps for each course in turn).
    6. Teacher logs out.

    UML1.4/Rational Rose 2003 [ 08SSD2.gif ] , Visio UML2.0 [ 08SSD3.gif ] , and Dia in CSci CSUSB Labs [ 08SSD4.png ]

    Exercises on SSDs

    Draw an SSD for this Use Case:

    Display unfulfilled orders at my depot

    1. Each morning the depot manager asks the system to display all the unfulfilled orders at his/her depot. The system responds with a list of unfulfilled orders.

    My answer: [ 08getUnfilled.gif ]

    More to come in the next class (see handout).

    Questions and Answers on SSDs

    [ 08q.html ]

    Next: Logical Packaging etc

    [ 09.html ]

    Next Project Iteration -- Domain Model 1

    [ w3.html ] due start of class 09.

    Review Questions

    [ 08r.html ]

    Standard Definitions

  1. CS202::= See http://cse.csusb.edu/dick/cs202/.
  2. CS372::= See http://cse.csusb.edu/dick/cs372/.

  3. DCD::diagram="Design Class Diagram", shows the classes that will be implemented in code.
  4. DRY::XP="Don't Repeat Yourself".

  5. ESSUP::Process= See http://www.ivarjacobson.com/essup.cfm, Ivar Jacobsen simplified "Essential" UP.

  6. Glossary::= See http://cse.csusb.edu/dick/cs375/uml.glossary.html.
  7. GoF::="Gang of Four", [ patterns.html#GoF ]
  8. GRASP::patterns="General Responsibility Assignment Software Patterns", a set of guidelines for designing objects and classes. They take a single event that the system must handle and determine a good class to carry it out. See [ patterns.html#GRASP -- General Responsibility Assignment Software Patterns ]
  9. Grades::= See http://cse.csusb.edu/dick/cs375/grading/.

  10. KISS::Folk_law="Keep It Simple, Stupid", in agile processes this means never drawing a diagram or preparing a document that doesn't provide value to the clients and stakeholders. In all processes it means never designing or coding what is not needed, see YAGNI.

  11. OO::shorthand="Object-Oriented".

  12. OOAD::="Object-Oriented Analysis and Design", See chapter 1 in text.
  13. patterns::="Documented families of problems and matching solutions", see Patterns.
  14. Patterns::= See http://cse.csusb.edu/dick/cs375/patterns.html.

  15. Process::="How to develop software".

  16. RJB::=The author of this document, RJB="Richard J Botting, Comp Sci Dept, CSUSB".
  17. RUP::Process="Rational UP", a proprietary version of UP.

  18. SSD::="System Sequence Diagrams", see chapter 10.

  19. TBA::="To Be Announced".

  20. UML::="Unified Modeling Language". [ Unified_Modeling_Language ]

  21. UP::="Unified Process", an iterative, risk-driven, and evolutionary way to develop OO software.

  22. YAGNI::XP="You Ain't Gonna Need It", an XP slogan that stops you planning and coding for things that are not yet needed. As a rule the future is not predictable enough to program a feature until the stakeholders actually need it now. In this class it means "It won't be on the final or in quizzes".

  23. XP::="Extreme Programming", the ultimate iterative code-centric, user-involved process.

End