December 2016
Beginner to intermediate
238 pages
6h 10m
English
© Kelt Dockins 2017
Kelt Dockins, Design Patterns in PHP and Laravel, 10.1007/978-1-4842-2451-9_25
Kelt Dockins1
(1)Dolph, Arkansas, USA
$> git checkout template_methodDefine the skeleton of an algorithm in an operation, deferring some steps to subclasses. The template method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure.1
The template method is useful when you have an algorithm that needs further instruction internally to run correctly. It fits well when an algorithm has steps, much like a cooking recipe. The Head First Design Patternsbook uses an example of making different caffeinated drinks. Making a cup of tea is very much like making a cup of coffee ...
Read now
Unlock full access