example design pattern - php