home

JavaScript Design Patterns: Observer

It’s time to introduce you guys to the Observer pattern. If you’ve been following this blog lately, you may have already had an introduction through my post talking about my jQuery plugin called JZ Publish/Subscribe. Well, here we’ll be talking about a few other ways to implement the Observer pattern, so you’ll know the method that works best for you and your application.

JZ Publish/Subscribe Version 1.2 Released

It’s a great day here at Joe Zim’s JavaScript Blog and surely a great day for the users of the JZ Publish/Subscribe jQuery plugin. This plugin has now been updated to version 1.2 and has gained probably the best feature it could gain at this point in its life and something that, arguably, maybe should have already been included with the plugin.

How and Why JZ Publish / Subscribe Should Be Used

If you don’t already know, JZ Publish/Subscribe is a jQuery plugin that I developed to add a simple, but powerful Pub/Sub feature to the jQuery utility functions. I’m guessing there are some people out there who don’t understand what Pub/Sub is, how to use it, or why to use it. I’m here to bring some answers and give a specific example of how JZ Publish/Subscribe can be used.

JavaScript Design Patterns: Proxy

This is the 9th installment of the JavaScript Design Patterns series and today we’re featuring the Proxy pattern. The word “proxy” can be defined as a substitute, and that essentially explains what a proxy is. A proxy is an object that has the same interface as another object and is used in place of that other object. The only question is why we would use a proxy instead of the original object.

JavaScript Design Patterns: Factory Part 2

In the last post, I started talking about the Factory Design Pattern, which creates objects for you, generally all of which follow the same interface. So far we’ve covered the Simple Factory, which creates this functionality in a Singleton object, which is the _simplest _way of creating a Factory, hence its nomenclature (I love that word). This time I’ll show you the true Factory.

JavaScript Design Patterns: Factory

Another post, another JavaScript design pattern. Today we feature the Factory pattern. The Factory pattern is one of my favorite patterns, especially the “simple factory”, which I’ll explain later. Factories – in real life as well as within the programming world – create objects. It helps clean up your code by removing all of the new operators.

SOPA and PIPA

News has been traveling around the internet about a bill that the American government is trying to pass, which is supposed to help prevent piracy of copyrighted materials via the world wide web. Though, I have no qualms with trying to keep piracy to a minimum, doing something utterly ridiculous that takes away the right to free speech that every American supposedly has isn’t going to gain my approval or the approval of any person with free will and a brain.

JavaScript Design Patterns: Decorator

Today I’d like to show another JavaScript Design Pattern: the Decorator, which is a way to add features to objects without subclassing or adding extra attributes. This post continues the JavaScript Design Patterns series that I started several months ago. If you’re new to the JavaScript Design Patterns series that I’m running here, you can find a list of the previous and upcoming posts in the series at the bottom of the post.

New Projects Section

All of you JavaScript lovers out there who have been following this blog recently will probably know already that I recently released a jQuery plugin to add Publish/Subscribe functionality. The Announcement was posted just a few days ago. Well, I decided I can’t just leave the information about the plugin in a post that will fade into the ages of the archive, so I created a Projects page, which you can access via the link on the main navigation bar.

New jQuery Plugin: Publish/Subscribe

I recently started looking through Dojo because another blog writer seemed to highly recommend it while saying there’s no real need to use jQuery. Dojo seemed quite powerful, probably having DOM manipulation on par with jQuery, but only if you required the correct extra modules. Also the syntax for Dojo is far more verbose. Still it seemed like Dojo had something that jQuery didn’t, so I sought to find what jQuery was lacking. It turns out that the only thing that Dojo (excluding Dijit and it’s other separate libraries) had that jQuery didn’t was a publish/subscribe module.