What is the need for Adapter Pattern in C#?If you want
to convert interface of your class into a different interface based on
Client expectations, then you can do it using adapter pattern. These two
interfaces will then work with one another to achieve the desired behavior.
By this way, you can make two classes work with one another even if they are incompatible. Here is a code template demonstrating usage of adapter pattern to make the interfaces of sampleClass1 and sampleClass2 work together: class sampleClass1
{
|