DESIGN PATTERNS
Facade
Rationale and Motivation
The facade pattern can make the task of accessing a large number of modules much simpler by providing an additional interface layer. 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 that is used to access them, the facade.
Advantages/Disadvantages
As stated before, the primary advantage to using the facade is the make the interfacing between many modules or classes more manageable. One possible disadvantage to this pattern is that you may lose some functionality contained in the lower level of classes, but this depends on how the facade was designed.
Examples
Imagine that you need to write some program that needs to represent a building as rooms that can be manipulated. Manipulated as in interacting with objects in the room to change their state. The client that has ordered this program has determined that there will only be a need for a finite number of objects possible in each room, and a finite number of operations that can be performed on each of them.
You, as the program architect, have decided that the facade pattern will be an excellent way to keep the amount of interfacing low, considering the number of possible objects in each room, and the actions that the client has specified.
A sample action for a room is to "prepare it for a presentation". You have decided that this will be part of your facade interface since it deals with a large number of classes, but does not really need to bother the programmer with interacting with each of them when a room needs to be prepared. Here is how that facade might be organised.
Consider the sheer simplicity from the client's side of the problem. A less thought out design may have looked like this, making lots of interaction by the client necessary.