Design patterns in php