Definitions - GerdHirsch/Cpp-TemplateFactoryMethod GitHub Wiki

Hook Methods

Hook Methods are variation points, the hot spots of the design. They can be overridden to redefine behavior of a specialization. They are typically protected or private! Because they must not be used outside of the context they are intended to. They have a default implementation.

Abstract Hook Methods

Are the same as Hook Methods but without a default implementation. They must be overridden to define behavior or the resulting class is also abstract.

Non Hook Methods

are not inteded to be specialized. They are defined in the base-class e.g. just to give a task a name.

Template Methods

Template Methods define a step by step procedure or algorithm in terms of Hook Methods and non Hook Methods.They typically cannot be overridden. They define in this way the invariant of the order of the steps of an algorithm.

Template Hook Methods

define a step by step procedure like Template Methods, but can be overridden to insert special steps or to remove some. Just to replace one, overridde the Hook-Method.