/////////////////////////////////////////////////////////////////////// // client.cpp - uses interface methods // // // // Demonstrates use of an abstract interface to communicate with // // several product class objects. // // // // Jim Fawcett, CSE687 - Object Oriented Design, Spring 2001 // /////////////////////////////////////////////////////////////////////// #include #include #include "abstract.h" #include "factory.h" using namespace std; void main() { cout << "\n Demonstrating use of Abstract Interface " << "\n with Factory Object " << "\n =========================================\n"; // use factory object's creational method factory fact; productAbstraction *pAP = fact.createProduct(); // use the interface pointer to call product's methods cout << endl; pAP->hello(); pAP->request("a request from client"); string productReply = pAP->reply(); cout << "\n " << productReply.c_str() << endl; // destroy product family delete pAP; }