A software example

The django-oscar-datacash module is a Django third-party module that integrates with the DataCash payment gateway. The module has a Gateway class that provides fine-grained access to the various DataCash APIs. On top of that, it also offers a Facade class that provides a less granular API (for those who don't want to mess with the details) and the ability to save transactions for auditing purposes [j.mp/oscarfac].

Caliendo, an interface for mocking Python APIs, contains a facade module which uses the Facade pattern for doing many different but useful things, such as caching methods and deciding what to return based on the input object which is passed to the top-level Facade method [j.mp/caliendofac].

Get Mastering Python Design Patterns 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.