Abstract factory pattern
It is one of creational design pattern. The abstract design pattern provide an interface for creating family of related or dependent objects without specifying their concrete classes. The Factory pattern construct single object where as abstract factory pattern construct multiple objects. In the above UML diagram, There is one abstract factory classs which having 2 virtual funtion createButton and createCheck. In the derived classes LinuxFactory and WindowsFactory class which create corresponding button and check object. If we create a application which have more than one theme dark theme or light theme, there we can use abstract factory pattern. Code: #include<iostream> using namespace std; class Button { public: virtual void Draw() = 0; }; class Check { public: virtual void Draw() = 0; }; class LinuxButton : public Button { public: void Draw() { cout<<"linux button"<<endl; } }; class LinuxCheck: public Check { public: void Draw(...