Examples of practical javascript object oriented design patterns

ming yeow picture ming yeow · Sep 16, 2010 · Viewed 59k times · Source

What object oriented design patterns do you use in your application's javascript, and why?

Feel free to post code, even if there is no formal design pattern attached to it.

I have written plenty of javascript, but I have not applied much object orientated patterns to what I am doing, and I am sure i am missing a lot.

Answer

Daniel Vassallo picture Daniel Vassallo · Sep 16, 2010

The following are three popular JavaScript patterns. These happen to be easily implementable because of closures:

You may also want to check out:

The following is a Google I/O talk from 2008 presented by Diaz, where he discusses some topics from his book: