2Problem: How to reuse behaviorSuppose we want to design a GUI toolkit with widgets, such as Button, Slider, etc.Problem:─Pressing the button should cause some operation to be invoked on some otherobject─But Buttonmust know the class of this other object in order to invoke that operation─So how do we make Buttonreusable?3Running exampleSuppose we are given the class:class DocManager {public:...void printDocument();void saveDocument();...};which is responsible for opening, closing, saving, and printing text documents4