Structural Design Patterns

🎭 Facade

💡Provides a simplified front face interface to hide a complex underlying code or architecture.

🧵👇

#100DaysOfCode #CodeNewbies #Developers #programming #code #developers
Benefits🤩

✅ improves readability and usability by hiding more complex interactions behind a common and simple interface
✅ provides a context-specific way to interact with a more general functionality
✅ It can be the initial change in a monolith to a more loosely coupled code
What tries to solve?

▫️ Make the subsystems easier to use
▫️ Merge logics and hidden into a more understandable method
▫️ Limit the logic exposed
👇
Example 1: We want to mimic an Uber app and to do so, we need a way to draw a route on a map.

We can provide a simplified service to hide interactions with the map, create routes, parse coordinates, calculate the midpoints, fit to streets, etc.
Example 2: We need to scope an EmailService to specialized to send marketing emails to current customers 📧💌

We could create a MarketingEmail class with templates and validations of customers' emails. The class will use the original EmailService to send the email.
Example 3: We could limit the interaction to a whole component in a loosely coupled architecture.

Think about an Order microservice, with their own service to process orders and a repository. We could expose an OrderComponent with limited access to internal parts.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Rodrigo 👋🤓

Rodrigo 👋🤓 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!