San Jose State University | CS 151 - OO Design Section 4 | Spring 2017

Homework 2

  1. Draw a UML class diagram of the following classes in a Piazza simulation, where we model just discussions (not notes or polls):
    Post
    Question
    Answer
    FollowupDiscussion
    FollowupResponse
    PiazzaSimulation
    User
    Draw aggregation and inheritance arrows. Be sure to add multiplicities to all aggregations. Also provide any attributes that you can discern from the Piazza user interface. For example, when it says “resolved” in the UI, somwhere there should be a “resolved” attribute.
  2. Draw an UML sequence diagram of the use case “Change the greeting” (including the login) on page 30 of the textbook. As with the diagrams in Figures 2-17 and 2-18, start from the Telephone.run method. You'll need to read through the code to see what actually happens, not guess what you think will be happening. Draw an arrow for each method call, but if there is a loop (e.g. entering multiple keystrokes), you just draw one arrow. (Note that the diagrams in Figures 2-17 and 2-18 are conceptual in nature, and they don't have self-calls to private methods in the Connection class. You should add them in your submission.)
  3. You can draw diagrams by hand and take a photo, or with the online tools at http://yuml.me and https://www.websequencediagrams.com/. Or use the Violet tool that you can download from http://horstmann.com/violet (classic) or http://violet.sourceforge.net (modern). Or if you like a different tool such as StarUML, that's fine too. Whatever you do, don't just submit the tool files but generate .png files.
  4. In your repo, submit two files piazza.png and change.png (named just so, with six lowercase letters and extension .png, also lowercase) in a hw2 directory (two lowercase letters and a digit, no spaces).
  5. Please add the grader as a collaborator with read/write access to your repo. The user id is sjsucs151s17grader.