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

8. Make Efficient Templates Using Hooks

Vaskaran Sarcar1  
(1)
Kolkata, West Bengal, India
 

This chapter will show you two important techniques. First, you will learn to use a template method. Why is this important? It is important because template methods are one of the fundamental techniques for code reuse. Suppose you follow a multistep algorithm to achieve a task. Using a template method, you can redefine some of these steps (but not all the steps) of the algorithm without altering the calling sequence of these steps.

This chapter starts with a demonstration that ...

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.