Archive for object oriented

Hospitality Service Scheduler Kata

Posted in Uncategorized with tags , , on February 27, 2013 by Shaun Elliott

A while back I was introduced to Uncle Bob’s bowling kata. If you’ve never done it before stop reading and go do it before proceeding here. The bowling kata is an excellent exercise in application design, feature creep and overall good OO skills. In the spirit of the bowling kata, here is a new OO design kata, the “Hospitality Service Scheduler Kata”.

Definitions:

“The hospitality industry is a broad category of fields within the service industry that includes lodging, restaurants, event planning, theme parks, transportation, cruise line, and additional fields within the tourism industry.” – Wikipedia

Within the hospitality industry there are many employees that are required to make a business run. Each of these employees have one or more defined jobs that they are capable of doing, for example: cook, janitor, manager. Additionally, each employee is capable of working a certain amount of shifts per day and per week per local laws and restrictions. Lastly, most hospitality business schedule employees by the week, 1-2 weeks in advance.

Suggested Requirements:

Write a class named “Scheduler” with the following methods:

  • getEmployeeSchedule( employee : Employee, duration : DateSpan )
  • getSchedule( duration : DateSpan )

Things to think about:

  • managing employees (crud operations, persistence agnostic)
  • managing jobs, titles, roles
  • ease of use\user stories

Example Use Cases:

Provide a report per employee for a given duration, it might look something like this:

Sally

Monday 9a-3p Server
Tuesday 10a-2p Hostess
Wednesday Off X

Provide a report for a given duration for all employees, it might look something like this:

Week:3/25/13

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

Sunday

Sally

9a-3p

Server

9a-3p

Server

9a-3p

Server

9a-3p

Server

9a-3p

Server

x

x

Billy

10a-6p

Cook

10a-6p

Cook

10a-6p

Cook

10a-6p

Janitor

10a-6p

Host

x

x

Tommy

1p-9p

Dishes

10a-6p

Dishes

10a-6p

Dishes

x

10a-6p

Dishes

x

x