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 ...
Get C++ Common Knowledge: Essential Intermediate Programming 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.