O'Reilly logo

Pro JavaScript™ Design Patterns by Dustin Diaz, Ross Harmes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 10The Facade Pattern

The facade pattern does two things: it simplifies the interface of a class, and it decouples that class from the client code that uses it. In JavaScript, facades are often a developer's best friend. Facades are the core principle behind nearly all JavaScript libraries. The facade pattern can make library utilities easier to understand by creating convenience methods that allow complex systems to be used easily and simply. Facades provide programmers with the ability to indirectly interact with subsystems in a manner that is less buggy and less error-prone than accessing the subsystem directly.

The facade pattern simplifies common or repetitive tasks such as error logging or keeping track of page-view statistics. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required