In order not to have to reinvent the wheel, one first looks for suitable finished concepts, which then only have to be adapted to one's own problem: Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. They gained popularity after the book Design Patterns: Elements of Reusable Object-Oriented Software was published in 1994 by the so-called "Gang of Four" (Gamma et al.), which is frequently abbreviated as "GoF".

The facade pattern  is used analogous to a facade in architecture. A facade is an object that serves as a front-facing interface masking more complex underlying or structural code. A facade can:

  • provide a simple interface to a complex subsystem (Improve the readability and usability of a software library by masking interaction with more complex components behind a single (and often simplified) API)
  • define an entry point to each subsystem level and make them communicate only through their facades, this can simplify the dependencies between them.
  • reduce coupling between clients and subsystems.

It typically involves a single wrapper class that contains a set of members required by the client. These members access the system on behalf of the facade client and hide the implementation details.

Facade pattern masks subsystem

Facade pattern masks subsystem (http://best-practice-software-engineering.ifs.tuwien.ac.at/patterns/facade.html)

One possible usage of the facade pattern and solution of our problem would be:

Client class School uses fassade class Csv which wraps predefined Python module csv

Client class School uses fassade class Csv which wraps predefined Python module csv


Last modified: Monday, 18 November 2019, 11:25 AM