Monthly Archives: August 2008

A Week in JavaScript Patterns: Lazy Function Definition

Lazy Function Definition is a pattern of functional JavaScript programming, similar to Load Time Configuration. The key difference is that the final function value isn’t configured at load time, but rather upon the first invocation of the function. The Lazy … Continue reading

Posted in Code, Design Patterns, JavaScript | Tagged , | 8 Comments

A Week in JavaScript Patterns: The Module

The Module is a brilliant design pattern which demonstrates the elegance of the JavaScript language by exploiting closure (one of JavaScript’s most powerful features) to create private members. The Module makes use of Self-invocation making it useful as an application … Continue reading

Posted in Code, Design Patterns, JavaScript | Leave a comment

A Week in JavaScript Patterns: Load Time Configuration

Load time configuration is the process where a JavaScript application configures itself as it is being loaded. This pattern is most commonly found in libraries in which they configure themselves at load time to be optimized for a particular browser. … Continue reading

Posted in Code, Design Patterns, JavaScript | Tagged , | 1 Comment

A Week in JavaScript Patterns: Self-invocation

I would like to begin this series of posts with one of the most useful and commonplace patterns in my code. Arguably, this can be considered a feature of the JavaScript language rather than a design pattern; however, when considering … Continue reading

Posted in Code, Design Patterns, JavaScript | Tagged , | 5 Comments