design pattern in php