Era we're now going to talk about the facade design pattern.
And before you ask that thing under the letter C is a Sadullah and that's what makes it pronounced as
s instead of.
So facade is a design pattern which may end up you having to write a Unicode character in some of the
identifier I see if you want to be 100 percent correct because that is what you would need to properly
specify the name if you want the name as part of your identifier which is a bit of a Java way to be
on.
So essentially the facade is all about exposing several components through a single interface making
things convenient for the end user.
So let's talk about the motivation.
I'm going to use the example of a house here.
So essentially a house is a system which tries to balance complexity.
On the one hand because to be honest a house is a building is a fairly complicated system but on the
other hand it has to have both presentation and usability which means when I'm buying the house I'm
essentially buying the way the house looks as well as how usable it is for my liking.
I'm not trying to measure you know the cross-section of the wiring being used in house necessarily or
any of the details.
So if you think about a typical home then you know it has many subsystems like for example you need
to have electricity in the house you need to have plumbing and sanitation functionality in the house
and so on.
You also have fairly complex internal structures in the house like for example the way the floor is
built.
It's actually kind of multilayered and everything but you don't want to worry about this and indeed
the end user when you go and you buy a house you're not really exposed to the internals there might
be really unpleasant bugs in the flooring for example but you'll never see them because you don't actually
open up the floors when you buy a house.
You don't go in that deep so you give it a superficial look.
You know the area of the house and where it's positioned and so on is what you enjoy and then you buy
the house.
That's how it typically works and the same goes with software in the sense that sometimes the consumers
of your API just want something simple to work with and show you how many systems and they're all working
together as a well oiled mechanism and they're doing something very complicated.
But the thing is the consumers want to do just work.
You just want a couple of simple function calls and get the system running.
So a typical example would be something like the console that we use throughout all the demos the console
is actually a complicated piece of machinery that has buffers it has plenty of settings but I can just
do console the right line and I've been doing that throughout the entire course and that's my API.
Essentially that's all that I am using so I don't need to worry about all the different buffers and
reallocations and buffer over on's and whatnot.
So all of this is kind of hidden from me and I'm just working with a public interface of what's essentially
a system or indeed sets of systems and working together.
So the facade design pattern is all about providing a simple easy to understand interface over a large
and sophisticated body of code.