Simplifying communication with the facade pattern
The facade pattern provides a unified interface to a set of underlying subsystems. In other words, a facade defines a higher-level interface that facilitates use. The facade pattern was described by the GoF.
Motivation
As subsystems evolve, they often become more complex. Most patterns, when used, result in smaller classes, thus making the subsystem more reusable and easier to customize, but also making it more difficult for all clients to work with. The facade pattern provides a simple default view of the subsystem that is good enough for most clients. Only clients who need more customizations will need to look beyond the façade pattern.
Finding it in the JDK
The Java collections framework resides in the java.base
module and java.util
has already been mentioned several times. It is a widely used part of the JDK, especially for internal logic implementation. Interfaces such as List
, Set
, Queue
, Map
, and Enumeration
...