What it is not so good for

Whenever the frameworks we implement using the template method design pattern become large, it is harder to simply extend a huge class and implement a few of its methods. In cases like these, passing an interface to the constructor and using it in the skeleton might be a better idea (strategy design pattern).

Get Scala Design Patterns - Second Edition 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.