The Facade Pattern hides the complexity of the system and provides clients with an interface through which they can access the system. This type of design pattern is structural in that it adds an interface to an existing system to hide the complexity of the system. This pattern involves a single class that provides simplified methods for client requests and delegate calls to existing system class methods.
class FacadePattern { public static void main(String[] args) { boolean result = new Facade().prove(); System.out.println(result); } } class SubFlow1 { boolean isTrue() { return true; } } class SubFlow2 { boolean isOk() { return true; } } class SubFlow3 { boolean isGoodMan() { return true; } } class Facade { SubFlow1 s1 = new SubFlow1(); SubFlow2 s2 = new SubFlow2(); SubFlow3 s3 = new SubFlow3(); boolean prove() { return s1.isTrue()&&s2.isOk()&&s3.isGoodMan(); }}Copy the code