A façade usually means the front of a building or a deceptive external appearance. In what way is the Façade pattern using its deception? By providing a simple interface to the user which veils the complexities of underlying system.
Let’s dive into it as an example will clarify the concept! Our Façade will be a new revolutionary Operating System. Indeed, our OS will provide an enhanced UI experience with its sleek, elegant and simple interface. As you all now, the underlying system/complexity consists of the different hardware components and their interactions. Therefore, we will create a Façade in which OS related tasks appear deceptively simple to the end-user.
The class myOS functions here as a Façade. As we can see, when an endUser executes pushPowerButton(), the Façade kicks in and execute the bootup operation. This is basically all the end user will ever see. Behind the scenes, each subsystem which is represented by a class get initiated and takes care of its purpose.
To create objects for each subsystem as showed above, is called Composition. Also, it is clear that all objects are loosely coupled to each other, this ensures maintainability of your program.