Examples and exercises from the O'Reilly book "Head Firs Design Pattern",