← Back to Week 5
Workbook 4a Module 1 — Exercise 2 (Paper)

Hotel Responsibilities

Take your object list and assign each responsibility to exactly one object  |  Workbook p.13

The Exercise

Continue from Exercise 1. Make a list of the responsibilities required to run this hotel. There are two flavors:

KNOW — what information does this object need to remember?
DO — what tasks or actions does this object need to perform?

Use your object list from Exercise 1 and decide which object should own each responsibility. Each responsibility is assigned to exactly one object. As you go, you might discover you need new objects, or that some you wrote down before are unnecessary.

Template — Use This Format Per Object

For each candidate object, fill out a card like this. The blanks are for you — the workbook isn't going to hand you the answers.

Object: ____________________
KNOWS
Information / data this object holds
Item 1
Item 2
Item 3
DOES
Actions / methods this object performs
Action 1
Action 2
Action 3
Concepts You'll Use
Flow
Take object list from Ex 1
List KNOW + DO per scenario
Assign each to ONE object
Spot low cohesion
Spot missing classes
Refine: split or merge
Tip
Each responsibility belongs to exactly one object. If two objects feel like they need the same responsibility, that's a sign one of them is wrong — or that you're missing a third object that should own it.

Note: this is a brainstorm exercise — there's no single right answer, but there are wrong ones. A class doing too many unrelated things has low cohesion; that's a smell, fix it by splitting.

Workbook 4a Module 1, p.13 — Exercise 2: Hotel Responsibilities

← Hotel Objects Hotel Operations →