What it is not so good for?

It could be problematic if the objects and methods we are using (SimpleConnection, in our case) change signatures. In some cases, this pattern could also complicate our code unnecessarily and make it unreadable and hard to follow.

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.