Item 22. Template Method
The Template Method pattern has nothing whatsoever to do with C++ templates. Rather, it’s a way for a base class designer to give clear instructions to derived class designers concerning how the base class contract may be implemented (see Polymorphism [2, 3]). However, even if you think this pattern should go by a different name, please continue to use the standard name “Template Method.” Much of the benefit of using patterns derives from the standard technical vocabulary they establish (see Design Patterns [3, 7]).
A base class specifies its contract to the world at large through its public member functions and specifies additional details for classes derived from it through its protected member functions. Private ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access