This pattern, reminds me of this Joke:
Artificial Neural Networks is like teenage sex.
Everyone talks about it.
Nobody really knows how to do it.
Everyone thinks everyone else is doing it.
So everyone claims they are doing it… 😝
The term facade means the principal front of a building, that faces on to a street or open space.
Apparently, you are dealing with the UI part, rather than seeing the inside plumbing, wiring etc of a house.
- The network library
Retorfitblack boxes, the complex system, and provides simple functions for API handling.
EncryptionLibraries, also black boxes, the complex encryption and provides simple ways to hash, encrypt files.
Typically, if there is a complex part (for eg:- ML or CV) in your project, the person knowledgeable at this, could create a Facade, so that, other people could work using it (and do productive things like UI/X etc), rather than spending time, understanding the complex part. We can avoid the complex wiring.
Rotate Cube Example:
The example provided is not complete, but enough to get an overall understanding. This example reminds me of the Juspay Hiring Challenge, when I was supposed to create a rotating cube (I couldn’t complete it btw).
Implementation in Java
- Lets start creating the inner wiring (plumbing).
2. Create a Driver to implement the facade.
Found it Interesting?
Please show your support by 👏. To read the complete series, click below.
I myself, has just started learning, design patterns. If you find any issues please feel free to post them in the comments section below. Thank you for reading so far 😄