Contents tagged with Adapter
today I want to make post about one of design patterns which is called Adapter. There are many articles over the web about this topic, but I hope to bring some clarity in this area.
Before I proceed any further, let me describe situation, when you can need it. One of the cases for consideration can be option, if you have your own class, let's name it A. And then let's say that there is some other class B, which has some needed function for you. For example like this:
How you can deal with this? One of the common ways which many people do, is to use class be directly in your code. For example like this:
Aggregate class B from class A in some kind of function, and do … more