g
Is the value 42
an object?
Consider designing a system where students can take online quizzes such as this one? What would not make a good class?
Student
Question
EvaluateResponses
WrongAnswer
In the voice mail system, consider the responsibility:
Remove a message from a mailbox
Which class should be responsible?
Mailbox
User
Message
MessageQueue
lab2
subdirectory of your personal repo, the other submits a file report.txt
in the lab2
subdirectory of your repo.cd ~/cs151 mkdir lab3 touch lab3/report.txt
lab3
with lowercase letters and no spaces. Now open the file in your favorite text editor.We want to design a program that simulates Piazza in the same way that the voice mail simulation simulates a real voice mail system.
Jointly come up with a list of classes that you think will be needed.
Scribe: Write down the classes that you came up with
Think of the key scenarios that are happening in Piazza. One of them is: “Student asks a new question”. Write down other scenarios that are useful and that one might want to include in the simulation. (Stay away from complicated stuff like adding images or HTML editing.)
Scribe: Write down the scenarios that you came up with
Make a CRC card for each class that you discovered. Start playing through the three most interesting scenarios. Which classes are responsible for what?
For example, consider “Student asks a new question”. Do you have classes Student
and Question
? A class that manages a list of questions? Which class is responsible? And what is the responsibility?
You may discover new classes as you do this. That's ok.
Coder: When you are done, take photos of the CRC cards.