Façade

A single object that represents an entire subsystem.

The jQuery API is a Façade to its internal functionality.



Overview


The Façade pattern provides an interface that shields a client from complex functionality. This definition appears to closely match jQuery's API which provides an easy-to-use interface to traverse the DOM, perform Ajax interactions, event handling, and animation. None of these things is simple and each requires a large and complex body of JavaScript code.

The jQuery library is cross-browser, that is, it supports all popular browsers. This involves a huge effort on the part of the authors of jQuery; not only are there several browsers to support (IE, Chrome, Safari, Firefox), but each has different versions with differences among them. There are subtle, and not so subtle, differences between all these browsers as well as bugs for which clever workarounds needed to be found.

In summary, the API of jQuery is an implementation of the Façade pattern.



  Proxy
Adapter