tor administrator; Programmer programmer; Engineer engineer; // Upcasted pointers obsr[0] = &administrator; obsr [1] = &programmer; obsr [2] = &engineer; database->registerObserver (&administrator) ; database->registerObserver (&programmer) ; database->registerObserver (&engineer) ; cout<<"Administrator, Programmer and Engineer Registered"<<endl; database->editRecord( ; database->removeObserver (&programmer) ; cout<<endl<<"Programmer Removed"<<endl database->editRecord( ; // Output of the observer program is shown in Figure 33.3. "D:\desktop_08_09\refer\DesignPatterns\Observer\Debug\observer.exe" Administrator, Programmer and Engineer Registered Administrator got notified Programmer got notified Engineer got notified Programmer Removed Administrator got notified Engineer got notified Press any key to continue_ Figure 33.3 Output obtained on executing observer program. Fundamentals of EMS, NMS and OSS/BSS 33.5 Factory Design Pattern Overview: This pattern is used to eliminate the scenario of frequent change in core code. In this pattern the core code is moved to a factory where decision logic is implemented. The changes specific to an implementation are moved, which ensures that the core code is not complex. Example of usage in telecom management programming: This pattern is quite common in telecom management application development where ever the pro- grammer finds the core code is becoming complex due to frequent changes being introduced. A typical example of the usage of this pattern is in implementing con- nection logic with multiple databases. The factory class only decides what database to connect, while the actual implementation of connection logic for a specific data- base is coded in a separate class. Implementation: // Factory Design Pattern // ver0.0 Jithesh Sathyan Aug 03, 2009 #include <iostream.h> static enum { Oracle_type, MySql_type } ; class connection public: virtual description ( ) cout<< "Generic connection" <<<endl; class Oracle: public connection public: // code for Oracle connection descript