implmented design patterens in php