Reader small image

You're reading from  TypeScript 4 Design Patterns and Best Practices

Product typeBook
Published inSep 2021
Reading LevelIntermediate
PublisherPackt
ISBN-139781800563421
Edition1st Edition
Right arrow
Author (1)
 Theofanis Despoudis
Theofanis Despoudis
author image
Theofanis Despoudis

Theo Despoudis lives in Ireland, where he works as a Software Engineer for WP Engine and as a part-time tech practitioner for Fixate. He is the co-author of The React Workshop and Advanced Go Programming in 7 Days, Dzone Core Member, and maintains some open source projects on GitHub. Theo is available for conference talks, independent consulting, and corporate training services opportunities.
Read more about Theofanis Despoudis

Right arrow

Façade pattern

Façade is a pattern that also wraps one or more interfaces and hides the complexities of using complex workflows under a simpler interface.

When you have some workflows that need to be orchestrated in a specific manner, such as calling one service and then the other under certain criteria, it's quite tricky to bring this logic across your components every time. With this pattern, you hide all those complexities behind an API and offer a simpler, more readable way to call those workflows. In simple terms, you use a function to wrap many service calls together so that the client will call it with fewer parameters.

One analogy of this pattern is having a smartphone, and you have to type the number you want to call. Instead of calling the number by typing it, you use quick actions to obtain a number from a list and you call the number when you tap on the quick action button. Although you can still manually enter the numbers, the UI Façade can carry...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
TypeScript 4 Design Patterns and Best Practices
Published in: Sep 2021Publisher: PacktISBN-13: 9781800563421

Author (1)

author image
Theofanis Despoudis

Theo Despoudis lives in Ireland, where he works as a Software Engineer for WP Engine and as a part-time tech practitioner for Fixate. He is the co-author of The React Workshop and Advanced Go Programming in 7 Days, Dzone Core Member, and maintains some open source projects on GitHub. Theo is available for conference talks, independent consulting, and corporate training services opportunities.
Read more about Theofanis Despoudis