JavaScript Observer Class
Novembro 9, 2006
First off, let me be the 763rd person to say that JavaScript does not have have a formal class system, however it does have the expressive nature to represent the notion of a class. That being out of the way, this entry is about representing the Observer Pattern in JavaScript; otherwise known as the publisher/subscriber model. As some already might know, it is already well demonstrated in modern event handling BOM’s such as IE’s attachEvent or W3’s addEventListener which allow you to register multiple listeners, and notify each callback by firing one event.
[Via Dustin Diaz]
Entry Filed under: +geek, javascript. .
Trackback this post | Subscribe to the comments via RSS Feed