Facade Pattern - Design Patterns in JavaScript

preview_player
Показать описание

The facade pattern is analogous to a facade in architecture, it is pretty on the outside and hides the underlying complexity

The facade pattern helps mask the complexity of underlying code, provides a single interface to a set of interfaces, and can help make complex code more context-specific.

Why not use a facade pattern? Facades can become "God objects" that are too complex to use.

Examples of a facade pattern
* Backend for frontend (BFF) layer - Join multiple services together to server a UI
* An external-facing API - Make a complex internal API more user-friendly with a facade

0:00 Intro
0:41 Why use a facade pattern?
1:11 Citisisms on the facade pattern
1:29 Examples of the facade pattern
2:12 JavaScript example

🌎 Follow me here:
Рекомендации по теме
Комментарии
Автор

I abslutely loved using Proxy facade (for a hobby project), there is some caching going on, important informational properties being recorded, data accessed and decoded. Doing it through a Proxy with seemingly few and simple methods exposed is a saving grace for actually using what I made.

danser_theplayer
Автор

I don't understand though why you would use an ifee here.

danser_theplayer
Автор

Very nice explanation. Proxy pattern next, maybe.

vaibhavdn-builds
Автор

Hi Tom, I love your videos. Can you make a MVC design pattern in js

dmitriispiridonov