This article will shed some light on Façade Patterns that are just an interface.
Façade means “face or front”. A Facade Pattern works as the name implies.A definition as given below is referenced from dofactory.
In layman terms “façade provides an interface to interact with sub layers to provide the desired result without interacting with sub layers directly from the console”.UML class diagramI have used a very basic and daily used real life example to show the case. A Mobile shop.Whenever a customer enters a mobile shop and asks about mobile phones of a specific brand such as Samsung but under the budget (the budget could vary) . Please have a look at the image given below:As in the image shown above, the customer is asking for a phone of the brand Samsung under 15000 INR. He just asks for an interface/façade layer “shopkeeper”. It doesn't matter for him what happens behind the scenes but he wants the mobile as desired.I hope the scenario is clear.Now we jump into a code segment and understand it practically.This is the typical class diagram for the Façade pattern:The classes, interfaces and objects in the preceding class diagram can be identified as follows:Stock and Price: Subsystems.MobileFacade: Facade class.Structural code in C#This structural code shows the Facade pattern that provides a simplified and uniform interface to a large subsystem of classes.The subsystem classes Stock and Price code are depicted below:
Programming Dictionary in C#