X Tutup
/////////////////////////////////////////////////////////// // Factory.cpp // Implementation of the Class Factory // Created on: 01-十月-2014 18:41:33 // Original author: colin /////////////////////////////////////////////////////////// #include "Factory.h" #include "ConcreteProductA.h" #include "ConcreteProductB.h" Factory::Factory(){ } Factory::~Factory(){ } Product* Factory::createProduct(string proname){ if ( "A" == proname ) { return new ConcreteProductA(); } else if("B" == proname) { return new ConcreteProductB(); } return NULL; }
X Tutup