4.1. Unification principle – adaptation by inheritance
Hook methods can be viewed as placeholders that are invoked by more complex methods, usually called template methods[1] (Wirfs-Brock and Johnson, 1990; Gamma et al., 1995; Pree, 1995;Fayad et al., 1999a, b, c). The simple idea behind hook methods is that overriding hooks allows changes of the corresponding template method's behavior without having to alter the source code of the class to which the template method belongs.
[1] Template methods must not be confused with C++ template construct – this has a completely different meaning.
The essential set of framework construction principles can be derived from considering all the possible combinations of template and hook methods within one class ...
Get UML Profile for Framework Architectures, The 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.