Template Method Hooks
A hook is a method call that a developer places in his or her code to give other developers a chance to insert code at a specific spot in a procedure. When you are adapting another developer's code and you need control at a point where you don't currently have it, you can request a hook. An obliging developer can add a method call at the point that you need it. The developer will also usually supply a stubbed-out version of the hook method so that other clients need not necessarily override the hook method.
Consider the Aster star press that discharges its chemical paste and flushes itself with water when shutting down. The press has to discharge this paste to keep it from drying and clogging the machine. At Oozinoz, you ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access