Code sample for learning design pattern