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.



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

1 Customer
2 Door


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.

1 Key
3 Boolean
4 Boolean
5 Door


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

1 Integer
2 Boolean
3 Boolean


1 To have a Lock
2 To have a name

1 Lock


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

1 Integer
2 Boolean

I don't know if this is good
Jennifer Raccuglia

I came up with something that was alot like that.


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?

3 Give a customer a key
4 Knows datatabase


Link to this Page