Facade
Facade (also known as Façade) design patterns are a curious thing; they essentially act as a simple interface to a complex system. A Facade design pattern works providing a single class that in itself instantiates other classes and provides a simple interface to use those functions.
A warning when using such pattern is that, as classes are instantiated within the Facade, you are essentially tightly coupling the classes that it utilizes. There are cases where you want this, but there are cases where you do not. Where do you do not want this behavior, you are better suited to using dependency injection.
I have found this to be useful when wrapping a set of poor APIs into a single unified API. It reduces external dependencies, allowing complexity ...
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