This article provides a brief introduction to Facade Design
Patterns. Facade Design pattern provides an easy to use interface to an
otherwise complicated collection of interfaces or subsystems. It makes things
easier by hiding the details of the implementation.
When designing good programs, programmers usually attempt to
avoid excess coupling between module/classes. Using this pattern helps to
simplify much of the interfacing that makes large amounts of coupling complex
to use and difficult to understand.
In a nutshell, this is accomplished by creating a small
collection of classes that have a single class (Facade) that is used to access
them.
The facade pattern is an object-oriented design pattern. A
facade is an object that provides a simplified interface to a larger body of
code, such as a class library. A facade can accomplish all of the following.
- It can make a software library easier to use and
understand since the facade has convenient methods for common tasks.
- It makes code that uses the library more readable for the
same reason.
- It can reduce dependencies of outside code on the inner
workings of a library since most code uses the facade. This allows for
more flexibility in developing the system.
- It can wrap a poorly designed collection of APIs with a
single well-designed API.
The following Non-software and software examples demonstrate
this pattern.