© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
V. SarcarSimple and Efficient Programming with C# https://doi.org/10.1007/978-1-4842-7322-7_7

7. Add Features Using Wrappers

Vaskaran Sarcar1  
(1)
Kolkata, West Bengal, India
 

An alternative to inheritance is composition. It is quite common in programming and often gives you a better payoff. This chapter shows you a useful case study on this topic using some wrappers.

The first question that may come into your mind is: what is a wrapper? A wrapper is like a topping that surrounds an object. In programming, you often use a wrapper to add some functionalities dynamically. This is a powerful technique because you can add or discard a wrapper as per your needs, ...

Get Simple and Efficient Programming with C#: Skills to Build Applications with Visual Studio and .NET 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.