© Vaskaran Sarcar 2020
V. SarcarDesign Patterns in C#https://doi.org/10.1007/978-1-4842-6062-3_8

8. Adapter Pattern

Vaskaran Sarcar1 
(1)
Garia, Kolkata, West Bengal, India
 

This chapter covers the Adapter pattern.

GoF Definition

Convert the interface of a class into another interface client’s expect. Adapter lets classes work together that otherwise could not because of incompatible interfaces.

Concept

From the GoF definition, you can guess that this pattern deals with at least two incompatible inheritance hierarchies. In a domain-specific system, the clients are habituated on how to invoke methods in software. Those methods can follow an inheritance hierarchy. Now assume that you need to upgrade your system and need to implement a new inheritance hierarchy. ...

Get Design Patterns in C#: A Hands-on Guide with Real-world Examples now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.