From leavens@larch.cs.iastate.edu Sat Mar 9 10:16:49 2002 Date: Fri, 8 Mar 2002 12:33:05 -0600 (CST) From: Gary T. Leavens To: Com S 362 students and staff -- Brian A Fiscus , com_s_362@cs.iastate.edu, Neeraj Khanolkar Subject: Corrections to sample answers for SSDs in todays class Hi, I'm sorry we ran out of time before I realized this today. But the system sequence diagram (SSD) we put on the board today is wrong. It's wrong in an important way that I thought I'd better point out to you all. Here's an explanation, starting with the wrong thing we did and ending with a correction. In class for the VCR example, we came up with something like the following for the SSD: (incorrect SSD) O \|/ |---------| / \ Set Record Times | :System | (:System should be underlined) :User |---------| (:User should be underlined) | startProgramming() | |------------------------------->| |-------------------------------------| | | | | | | selectChannel() | | | |<------------------------------ | | | | channel | | | |- - - - - - - - - - - - - - - > | | | | | | | | | | | | enterTimes() | | | |<-------------------------------| | | | times | | | |- - - - - - - - - - - - - - - ->| | | | | | | | confirm() | | | |<-------------------------------| | | | | | | | *[more items] | | |-------------------------------------| | | | doneSelecting() | |------------------------------->| The problem with the above diagram is fundamental. It is that the system is sending messages to the user. But the user is not a computer system, it's a person, so the user can't get messages. This also tends to focus too much on the user interface (UI), getting embroilled in details of prompting and confirming that aren't really important for the story. (They aren't UI-free. Another way to look at the above is a design for the UI itself, but we're not focusing on that.) So, instead, what should be done is to have all the system operations be messages sent from (the UI on behalf of) the user to the system. The information the user enters is to be packaged up (by the UI) and sent to the system (the application level). So the SSD should really look like the following: (corrected SSD) O \|/ |---------| / \ Set Record Times | :System | (:System should be underlined) :User |---------| (:User should be underlined) | startProgramming() | |------------------------------->| |-------------------------------------| | | | | | | desiredChannel(channel) | | | |------------------------------->| | | | | | | | | | | | desiredTimes(times) | | | |------------------------------->| | | | | | | | *[more items] | | |-------------------------------------| | | | doneSelecting() | |------------------------------->| Now all the arrows go from the user (really the UI) to the system (really the application logic layer). This makes it possible for the system operations to be programmed in interaction diagrams, because the system operations go from the user to the system, something like: -> startProgramming() |----------------| ----------------------->| :RecordHandler | |----------------| ... whereas the other way around doesn't work, as we can't send messages to the user. I hope that clears things up, and sorry for any confusion my not catching this at the end of class may have caused. -- Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1040 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580