Common Design Patterns in JavaScript

Anyone who has been programming for some time has come to realize the value of understanding design patterns, regardless of whether or not your background includes a CS degree. In my experience though, I have found that deciphering the definition of a particular design pattern or understanding its use cases can be more difficult than actually coding it. Still, when it gets to implementing the pattern, sometimes translating a pattern from the textbook definition (oftentimes in Java) to whatever language you are working in can be difficult as well.

This is why I am excited about the series of articles Joe Zimmerman is doing for the ADC on implementing common design patterns in JavaScript. Not only does he manage to explain each pattern in easy to understand terms and describes common use cases, but he shows simple examples of how you would implement this pattern using JavaScript. In his most recent article, he covers the adapter, decorator and factory patterns, while his first article covered the singleton, composite and facade patterns. He also has many of these and more posted to his blog.

While you may not require each particular pattern immediately, they are always useful tools to have in your toolbox to use as needed. You also may rely on a framework which uses some of these patterns and understanding the underlying principles can be helpful in your proper use of the framework. Either way, I believe this series of articles (part 3 is coming soon) is well worth reading.

Comments are closed.