public WidgetClient(WidgetCreatorName widgetCreaterName) { AbstractFactoryAgent objAbstractFactoryAgent = new AbstractFactoryAgent(widgetCreaterName); widgetFactoryObj = objAbstractFactoryAgent.GetFactoryObject(); Window = widgetFactoryObj.CreateWindow(); Scrollbar = widgetFactoryObj.CreateScrollBar(); Toolbar = widgetFactoryObj.CreateToolBar(); Button = widgetFactoryObj.CreateButtons(); }
public Widget(IWidgetFactory widgetFactory) { _button = widgetFactory.CreateButton(); _scrollBar = widgetFactory.CreateScrollBar(); }