Facade Design Pattern in Java

By | July 5, 2020

In this post, We will talk and learn about the Facade Design Pattern in Java.

  • Facade design pattern is used to help the client applications; it doesn’t hide subsystem interfaces from the client. Whether to use Facade or not is completely dependent on the client application.
  • We can apply Facade design pattern at any point of development when we find the number of interfaces grows and the system gets complex.
  • In Facade Design Pattern subsystem interfaces are not aware of Facade and they should not have any reference to the Facade interface.

Now Let’s move towards the implementation of the Facade Design Pattern.

Below is the complete source code:

Facade Design Pattern

Facade Design Pattern Project

ExcelReport.java

HtmlReport.java

PdfReport.java

ExcelReportImpl.java

HtmlReportImpl.java

PdfReportImpl.java

ReportFacade.java

ClientTest.java

Output of this client Program:

PDF report generation logic is here..
HTML report generation logic is here..
EXCEL report generation logic is here..
—————————————————
PDF report generation logic is here..
HTML report generation logic is here..
EXCEL report generation logic is here..

 

You May Also Like:

Singleton Design Pattern in java
Prototype Pattern in Java
Factory Pattern in Java
Abstract Factory Pattern in Java
Builder Pattern in Java
Adapter Design Pattern in Java
Decorator Design Pattern in Java

That’s all about the Facade Design Pattern in Java.
If you have any feedback or suggestion please feel free to drop in below comment box.

Leave a Reply

Your email address will not be published. Required fields are marked *