Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes.

A facade is a class that provides a simple interface to a complex subsystem. A facade might provide limited functionality, however, it includes only those features that clients need. This is very important when you need to integrate your application with a sophisticated library, but you only need a small part of its functionality. Subsystem classes aren’t aware of the facade’s existence. They operate within the system and work with each other directly.
How it works (code examples):
public class Blender {
public void blend(){
System.out.println("Blending fruits and nuts smoothie.");
}
}
public class CoffeePot {
public void boil(){
System.out.println("Boiling coffee.");
}
}
public class Toaster {
public void heat(){
System.out.println("Heating bread.");
}
}
public class PrepareBreakfastFacade {
Blender belnder;
CoffeePot coffeePot;
Toaster toaster;
public PrepareBreakfastFacade (
Blender blender,
CoffeePot coffeePot,
Toaster toaster) {
this.blender = belnder;
this.coffeePot = coffeePot;
this.toaster = toaster;
}
public prepare() {
System.out.println("Preparing breakfast.");
blender.blend();
coffeePot.boil();
toaster.heat();
}
}
public class PrepareBreakfastTest{
public static void main (String[] args) {
Blender blender = new Blender();
CoffeePot coffeePot = new CoffeePot();
Toaster toaster = new Toaster();
PrepareBreakfastFacade prepareBreakfastFacade = new PrepareBreakfastFacade (blender, coffeePot, toaster);
prepareBreakfastFacade.prepare();
}
}
Related patterns: Adapter, Abstract Factory, Flyweight, Mediator, Singleton, Proxy.