O'Reilly logo

jQuery Design Patterns by Thodoris Greasidis

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

The Module Pattern

The key concept of the basic Module Pattern is to provide a simple function, class, or object that the rest of the application can use, through a well-known variable name. It enables us to provide a minimal API for a Module, by hiding the parts of the implementation that do not need to be exposed. This way, we also avoid polluting the Global Namespace with variables and utility functions that are needed for internal use by our Module.

The IIFE building block

In this subsection, we will get a small introduction to the IIFE Design Pattern since it's an integral part for all the variants of the Module Pattern that we will see in this chapter. The Immediately Invoked Function Expression (IIFE) is a very commonly used Design Pattern ...

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