Facade pattern
easy 50 minThe Facade pattern gives a group of classes one simple front.
Watch lesson4:23
Where it shows up
The same pattern appears across everyday software.
Python: subprocess.run
The documentation recommends run() for all use cases it can handle. For more advanced ones the underlying Popen interface can be used directly: a lever and a side door.
Requests: requests.get
One function call. Behind it a Session provides cookies, connection pooling and configuration. Who needs these uses the Session.
Spring: JdbcTemplate
The central delegate of Spring's JDBC package. It opens and closes connections and statements and translates exceptions, so that the caller gives SQL and gets rows.
boto3: upload_file
Takes a file name, a bucket name and an object name. It handles large files by splitting them into smaller chunks and uploading each chunk in parallel.
Git: porcelain and plumbing
The Pro Git book calls low-level commands plumbing and the friendlier ones porcelain. git commit is a front over commands that write objects and move references.
jQuery.ajax
One function with a settings object in front of the browser's XMLHttpRequest, with callbacks for success and error.
Python: shutil.make_archive
Creates an archive in one call. The documentation says that these utilities rely on the zipfile and tarfile modules, which remain available.
SLF4J
The Simple Logging Facade for Java serves as a simple facade or abstraction for various logging frameworks. Because the framework is chosen at deployment, it also behaves like a bridge.
Remote Facade
In Martin Fowler's catalogue: a coarse-grained facade on fine-grained objects, to improve efficiency over a network.