Here is the code of the tutorial on design pattern