Let’s talk about Facade pattern on example. We search house and basically we want to have building with facade, that hide a lot of things. For example, brick wall, water supply systems, power supply systems, security systems etc. But customer, may don’t know about inner structure of house, he want to know that light works properly, he can take a shower. So, customer see only facade of building (in a broad sense).

And similar approach we can use when we create application. Use facade for very complex systems when our users needs only superficial interface. User shouldn’t know about complicated structure of inner systems.

In the next example we will see two classes — Point, Line. If you want to create some figure, you should use both classes. In this case we can create FirgureFacade class, that will allow to create figure using only one class, it will be more simple for user.

    internal class Program
    {
        static void Main(string[] args)
        {
            FigureFacade figureFacade = new FigureFacade();
            figureFacade.Draw();

            Console.ReadLine();
        }
    }

    public class FigureFacade
    {
        private Line line;
        private Point point;
        public FigureFacade()
        {
            line = new Line();
            point = new Point();
        }
        public void Draw()
        {
            line.Draw();
            point.Draw();
        }
    }

    public class Line
    {
        public void Draw()
        {
            Console.WriteLine("Drawing Line");
        }
    }
    public class Point
    {
        public void Draw()
        {
            Console.WriteLine("Drawing Point");
        }
    }

Result of this program will be: