3.11. Template Method
Perhaps you have encountered it many times already. The idea is to letsubclasses of this abstract template “finish” the behavior of analgorithm.
A.k.a the “Hollywood principle”: “Don’t call us, we call you.” Thisclass is not called by subclasses but the inverse. How? With abstractionof course.
It is an easy way to decouple concrete classes and reduce copy-paste,that’s why you’ll find it everywhere.
Journey.php
BeachJourney.php
Tests/JourneyTest.php