Facade Pattern

Façade pattern is a simple design pattern which is used to hide unwanted details for a module. Chances are that you have followed this pattern without even knowing that you are using it.

The literal meaning of Façade is front; that explains a lot about pattern. I have a habit of over simplifying things, so I will do the same here using a simple example. Say you need to fill up some forms to get admission to a college or club. There is a procedure to do that, first you need to go to clerk 1 and fill general info form, second you need to go to clerk 2 and fill a form for specific interests / courses. Than you need to go to third one for background check form and finally you need to get to fourth clerk for filling fees details.

Will it not be good if we could have done all this at one place in one form. Say there is a receptionist at front desk who takes all these details from you and is responsible for contacting all the clerks and getting details filled (obviously you are not aware of the clerks’ existence as you are only interacting with receptionist). That saves you from a lot of trouble and also helps institution to keep the direct dependency low. Say if they are changing location of a clerk, in first case they would need to tell hundreds of users about the change so that they can go to correct location, but in second case they are only telling the receptionist.

In above solution we are following façade pattern (to solve a real life problem). In software term the same stands true. Say you are interacting with this college system, earlier you were to fetch data from multiple classes which can be done from one façade class. Secondly maintenance is easy as background changes (change clerk location) will need a change only in façade class and no change for users using the API.

Case Original:

GeneralInfo generalInfo=new GeneralInfo();


CourseInfo courseInfo=new CourseInfo();


Fees fees=new Fees();


MoreInfo moreInfo=new MoreInfo();

enrollmentNumber= moreInfo.finallyFill(MyDetails);

Case Facade Pattern:

CollegeFacade collegeFacade=new CollegeFacade();


Facade Pattern