DELAPARRA
Index
Color
NL
Category: Design patterns

Facade

Explained by Updated

What is Facade?

Facade: Provide a simplified interface to a complex subsystem — hide internal complexity behind a single, clean surface. The Facade pattern offers one simple interface to a complicated set of classes. Instead of coordinating five services yourself, you call one method that does it for you. An OrderFacade might offer placeOrder(), which checks stock, reserves items, charges the payment and sends a confirmation. The calling code stays short and does not need to know the details.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Facade

What should you keep in mind with Facade?

In Laravel, "facade" means something slightly different: static-looking classes like Cache::get() that forward calls to services in the container. They are convenient, but they hide dependencies, so some teams prefer injecting the service explicitly. Either way, a facade should simplify, not hide problems. If it grows into a class that does everything, split it by task.

At a glance

CategoryDesign patterns
Explained by
Updated

More Design patterns terms

All terms starting with F

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.