I have a library class that I cannot change and a custom class. I want to use run time polymorphism on both but I cannot inherit from the library class since it is designed as a leaf class, nor from its far to general base class. What is the easiest and cleanest way to implement a common interface that serves as a “kind of base class” for both the library class and my custom class ? Is there a design pattern for something like this ?
Share
You could use the adapter pattern.