switch (style) {case MAC:case WIN:Button* button = fac->CreateButton();Border* border = fac->CreateBorder();
PHP.<?phpabstract class AbstractFactory {class MacFactory extends AbstractFactory{class WinFactory extends AbstractFactory{