share design pattern tutorial code