/////////////////////////////////////////////////////////////////////// // 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" using namespace std; void main() { cout << "\n Demonstrating use of Abstract Interface " << "\n with static Factory Method " << "\n =========================================\n"; // use abstract interface's static creational method productAbstraction *pAP = productAbstraction::createProduct(); // use the interface pointer to call implementation's methods cout << endl; pAP->hello(); pAP->request("a request from client"); string productReply = pAP->reply(); cout << "\n " << productReply.c_str() << endl; // destroy implementation delete pAP; cout << "\n\n"; }