beginning desigin pattern by PHP