Tuesday, September 12, 2006

Facade Design Pattern

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.

Thus, Facade is a design pattern that hides the details and complexities of the lower-level software services for which it is written, making the service easier to use.  In fact, the lower-level classes need not be classes at all; they can be an API in the form of a code library or a Web service.

A Facade also provides a unified entry point into the layers of the software.  This reduces the application's dependency on the software service details and allows the Facade to hide future changes in the software service itself.

 

Can't find what you're looking for? Try Google Search!
Google
 
Web eshwar123.blogspot.com

Comments on "Facade Design Pattern"