JavaScript design patterns

JavascriptDesign Patterns

Javascript Problem Overview


This is a question for general discussion. Are there any good, comprehensive resources for useful JavaScript design patterns. I am trying to avoid references that attempt to coerce JavaScript into, say, Java by imposing patterns more suited to another language. Let's let JS be JS and shape our patterns around the strengths.

Please any discussion would be valued by more than just me, I suspect.

Javascript Solutions


Solution 1 - Javascript

Solution 2 - Javascript

Solution 3 - Javascript

This is an awesome book by O'Reilly. It builds on their "JavaScript: The Good Parts".

enter image description here

It references a lot of the patterns mentioned in the "Gang of Four" book and notes a lot of the problems solved in that book are trivial to solve with JavaScript.

Solution 4 - Javascript

APress has a book called "Pro Javascript Design Patterns" that is probably just what you're looking for. While the author (Diaz Harmes) is certainly not "the gang of four", I think he does a pretty good job; I know I learned quite a bit from it (and it got 4.5 stars on Amazon).

Amazon link: http://www.amazon.com/JavaScript-Design-Patterns-Recipes-Problem-Solution/dp/159059908X

alt text

Solution 5 - Javascript

I'm not sure why no one has listed this, but Addy Osmani's JavaScript design pattern book is fantastic and freely available online. He really digs deep to show you the nuts and bolts of each pattern.

http://addyosmani.com/resources/essentialjsdesignpatterns/book/

Solution 6 - Javascript

Solution 7 - Javascript

This is one of the best design patterns resources I've found for JavaScript http://shichuan.github.com/javascript-patterns/

It's aimed for JavaScript as we know and not necessarily trying only use concepts of other languages.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjeromeView Question on Stackoverflow
Solution 1 - JavascriptdpanView Answer on Stackoverflow
Solution 2 - JavascriptfriedoView Answer on Stackoverflow
Solution 3 - JavascriptKeith.AbramoView Answer on Stackoverflow
Solution 4 - JavascriptmachineghostView Answer on Stackoverflow
Solution 5 - JavascriptSethenView Answer on Stackoverflow
Solution 6 - JavascriptgblazexView Answer on Stackoverflow
Solution 7 - JavascriptMilkyWayJoeView Answer on Stackoverflow