/////////////////////////////////////////////////////////////////////// // MyApplication.h - sublcass which overrides the factory method // // to return an instance of the concrete document // // object // // Language: Visual C++ 2008 // // Platform: Sony Vaio, Intel Core 2 Duo // // Application: Demonstrating Factory Method Pattern // // Author: Anjan Kumar, Bollam , CSE // /////////////////////////////////////////////////////////////////////// #ifndef MYAPPLICATION_H #define MYAPPLICATION_H #include "Application.h" #include "MyDocument.h" class MyApplication : public Application{ public: MyApplication() { std::cout << "MyApplication constructor" << std::endl; } virtual Document* CreateDocument(std::string docName) { std::cout << " MyApplication: CreateDocument() is called\n" ; std::cout << " Document " << docName<<" is created"<< std::endl; return new MyDocument(); } ~MyApplication(){}; }; #endif