Dale - Computer Science Illuminated 197

Dale - Computer Science Illuminated 197 - what classes must...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
170 Chapter 6 Problem Solving and Algorithm Design Class Name: Host/Hostess Superclass: Person Subclasses: Responsibilities Collaborations Send invitations Invitation, Person, List with two objects: one for the invitation list and one for the guest list. Here is the list of possible classes at this stage. Scenarios What are the scenarios that occur? Let’s begin with sending the invitations. Whose responsibility is it to send the invitations? The host or hostess. So send invitations must be added as a responsibility to the person class. No, that’s not right. It isn’t reasonable for all people to have this responsibility. Let’s make the host/hostess be an object of a class that is derived from the person class with the added responsibility of sending the invitations. With
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: what classes must the host/hostess class interact (collaborate)? The invita-tion class, the person class, and the list class. The CRC for the host/hostess class looks like this so far. Another scenario would involve the person class responding to an invita-tion. How would we simulate a person responding to an invitation? A message would be sent to the person asking him or her to respond if free on a certain date. Thus, the responsibility would be to respond if free with a parameter that represents the date. Oops, this scenario shows that we forgot the date object. How can a person carry out this responsibility? A person object must look at its calendar. ... Each person needs to collabo-...
View Full Document

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online