View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sp2000 Midterm Review: Hotel Doors OOA/D

Review at Midterm Review - Sp2000.


a) Key and Lock
Rejected: MasterKey class because its instance variable would be an
a collection of codes. What if you wanted to change the locks at
some point. The codes they recognize will most likely change,
therefore we would have to change all the codes in the MasterKey
class, and there are probably a lot of doors in this hotel, so
it would be a pain to maintain. Why not just have an instance
variable in the Key class that denotes if it is a master key or not.

I couldn't think of another class I would reject. Someone try
to answer this problem.

b)

Hotel
Responsibilities:

1 Keep track of a list of Customers.
2 Keep track of a list of Doors.
Collaborators:

1 Customer
2 Door

Customer
Responsibilities:

1 Keep track of the keys this particular customer has
2 To have a name
3 Has the customer lost the key?
4 Has the customer checked out yet?
5 Insert a key into a Door.
Collaborators:

1 Key
2
3 Boolean
4 Boolean
5 Door

Key
Responsibilities:

1 I have a code that corresponds to a lock
2 Am I a master key?
3 Am I invalid?
Collaborators:

1 Integer
2 Boolean
3 Boolean

Door
Responsibilities:

1 To have a Lock
2 To have a name
Collaborator:

1 Lock
2

Lock
Responsibilities:

1 To hold a code
2 Is key valid?
3 To tell Door it is open.
Collaborators:

1 Integer
2 Boolean
3

I don't know if this is good
Jennifer Raccuglia


I came up with something that was alot like that.

Classes

1) doorLock - knows which keys can open the door
2) key - has an encoded number that might open a door lock
3) customer - stays at the hotel for a period of time. has keys
4) centralLockDatabase - has a linked list of doorlocks. can reset each indivdual doorLock, when it recieves a message from the hotel.
5) Hotel - has a central lock database and customers


masterKey - REJECTED - its just a key that works on every door. So every door will one or more codes that work (think LinkedList).

Harper Maddox

Key issues in this problem: Who knows the correct key? Who knows the database? Who makes the key correct? Mark Guzdial

The Lock knows the correct code, which means it knows the
correct key.
Hotel is responsible for giving a correct key to the customer
Should the hotel actually make the keys correct?

Hotel
Responsibilities:
3 Give a customer a key
4 Knows datatabase

Jennifer



Link to this Page