i am dustin diaz

a JavaScriptr...

boosh.

don't worry about it.

Screencast 03: Developing an Object Oriented Web Service

In the third installment of the screecasts here at WSwI I'm glad to produce a whopping 45 minute episode which will teach you a good approach to developing JavaScript A.P.I.'s using Object Oriented methodologies as well as an all around practical usage of Yahoo! User Interface utilities; most notably the Connection Manager and Custom Event.

For this particular screencast I had decided to publish the the code in its fullness so that you may play around with it yourself to get a better understanding of it all. See Yahoo Services Demo. One exception you might notice in the demo code (that is different from the screencast) is that I've added one extra bit to prove a point of having an onWebServiceSucess. Eg:

onWebServiceSuccess in action

YAHOO.elseWhere = function() {

	var f = new YAHOO.WebService;

	f.onWebServiceSuccess.subscribe(

		function() {

			console.log("i'm just here for the ride");

			// excellent place to log your ajax stats

		}

	);

}();

You'll see the beauty in the fact that YAHOO.elseWhere didn't have to know what anyone else was doing with the web service - and all he/she needs to do is set up the Base WebService object and subscribe to the onWebServiceSucess method. Also, FYI for the accompanying code - you may actually experience a few onFailure's coming back due to the fact that my server is being hit pretty hard at the moment. Otherwise, Enjoy!

Download the Quicktime Version (53 MB)

If you cannot see the video below: get the DivX Web Player (available for both Win & Mac)

this is who i am

Hi, my name is Dustin Diaz and I'm an Engineer @ObviousCorp. Previously @Twitter, @Google, and @Yahoo, author of Strobist® Info co-author of JavaScript Design Patterns, co-creator of the Ender JavaScript Framework, a Photographer, and an amateur Mixologist. This is my website. Welcome!

On this site I write about JavaScript. You can also follow along with my open-source work on Github.

This site is optimized and works best in Microsoft Internet Explorer 6.