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)













September 17th, 2006 at 1:03 am
I’m looking forward to watch this screencast. But next time, it would be great if it was avilable on torrent too, so i can download it in less than an hour:).
September 17th, 2006 at 4:01 am
I second the torrent idea as the screencasts get bigger every time (not a bad thing though!)
September 17th, 2006 at 4:27 am
Huzzah! Web Web Services!
Another briliant screencast (with all the required typos and everything)!
Liked the animation stuff you did too, even though the framerate of the screencast was a bit to slow. Really Web2.0-ish stuff right there :)
I’m in on that torrent idea too, even though I usually download them from Thunderbird in less than half an hour, so it’s no biggie for me ;)
Looking forward to the next one!
September 17th, 2006 at 9:05 am
This serie of vidcast is a great idea, and is very well executed.
Your coding style is an inspiration for me, and I am looking forward to the next one.
I second the torrent idea… and I’m sure your bandwith would appreciate that too !
Keep the great work up Dustin !
September 17th, 2006 at 9:37 am
Well, I’m not a torrent user - and have no idea how it works, so if the first few people want to put it on there, I’m more than willing to let it happen. I’ve already put all the necessary copyrights on the video so everything is all good.
As you can see, I’ve already experimented with flash to see if it would speed things up - but to my unfortunate haphazzard, the quality is way under par and unacceptable.
Otherwise, the sizes will remain; they’re already using the amazing compression h.264 and actually they’re just about the size I expect especially for how long they are.
I’m still glad you guys are enjoying them :)
September 17th, 2006 at 9:48 am
@All: Ok so I must ask the community about this since I am not an aclaimed expert on video/audio. How do I make this work using the existing technologies of a mac with iLife ‘06, iShowU (for screen recording) and Quicktime 7 Pro. My recording hardware is the same stuff I use in my podcasts: M-Audio FastTrack Interface and a E835 Sennheiser Mic.
Problems to solve:
* Make the sound come out of both speakers
* Cut down the file size
Anyone?
September 17th, 2006 at 6:35 pm
Alright folks, I’ve found perhaps the best solution thanks to the good guys over at DivX which have made it possible to cut down the file size even more without losing much quality - and allowing me to embed the web player which has a codec available for both Windows and Mac users.
As for the sound issue, I simply have to re-export the movie as mono even though it was recorded as mono from my interface, iShowU assumes your output will always be stereo (or at least that’s my assumption). Thanks all for being patient :)
September 18th, 2006 at 1:06 am
Best way to start a Monday morning, love these screencasts. This is exactly what I am working on at work so should help out a lot.
Thanks
C
September 18th, 2006 at 4:46 am
This vidcast was really great, just like the others! It’s really neat to spend 45 minutes watching vidcasts and having a snack at the same time. Kinda like educational TV :)
Great job!
September 18th, 2006 at 8:17 am
Remember that with this DivX codec, you get full screen for free. Just right click (or ctrl click) on the video and choose ‘full screen’ - The quality turned out great. Also the .mov version turned out to only be 53M. I’m glad you guys are enjoying it.
September 18th, 2006 at 2:08 pm
Ahh, nice! Great way to reduce your file size, and the player looks smooth too. «100% buffer -> Showtime!» :)
I just have to say it again Dustin: Great screencast, I learned a lot from it, and I’m currently using some of the code on a contact page on nmuf.net. Really looking forward to the arrival of my new JavaScript books from Amazon and Sitepoint :)
September 18th, 2006 at 4:41 pm
Excellent screencast. The formats you posted worked out really well for me. (And loaded much faster than the last one!)
I like being able to download this one, because I’ll need to watch it a few times to comprehend everything. Overall, it’s a good pace.
September 19th, 2006 at 2:07 am
Rather long screencast, yet worth the time spent! Didn’t get bored at any time.
“Today I have learned…”
Thanks Dustin!
September 19th, 2006 at 11:59 am
Nice… too bad I already downloaded the 350mb file.
Has the code for the screencasts been put online as promised? I cant seem to find it.
Cheers
September 19th, 2006 at 2:09 pm
Dcaunt, you may wish to redownload the 53Mb version - mainly because it has sound that is output to both of your speakers.
September 20th, 2006 at 7:27 am
Great job on the screencast(s). I’ve been spreading the word on your site at the office, and all the folks here are enjoying them also. You are starting to win more people over to YUI!
Take care.
September 21st, 2006 at 5:37 pm
superb stuff dustin!
may I second the suggestion that was raised in screencast 2:
“A tip: what you could try in another screencast is explain to people how they can find out by themselfs how a YUI utility works.”
Someone also mentioned earlier about Aptana, a very interesting IDE - any PC users interested should really check it out; there’s even documentation on Getting started with Aptana and Yahoo UI:
http://www.aptana.com/docs/index.php/Getting_started_with_Aptana_and_Yahoo_UI
(Dustin, I would love to know what you think of this app too!)
Thanks so much Dustin, for taking the time out to do this!
September 21st, 2006 at 7:45 pm
@JohnL: I’m glad folks are finding YUI beneficial - but I hope even more that people are learning what you can do in JavaScript. Tell your office I said hello :)
@Adam: suggestion taken. RE: Apatana. It is an excellent IDE to practice and learn with. But after a while it’s only purpose (or rather benefits over others) is the helpful tooltips and autocompleting library code for you. So as you can see, I’m still a big Textmate fan and it’s my editor of choice.
September 26th, 2006 at 12:01 am
Great screencast! I loved it two times and learned a valuable lesson.
Also, thank you for shrinking all versions, now my friends won’t get scared by its size;)
October 2nd, 2006 at 2:57 am
What’s wrong with the Web DivX Player? I personally love it! There is no other player that loads videos so fast with such a high quality. And it’s cross-platform!
October 3rd, 2006 at 8:05 pm
Just watching you code effortlessly is a treat!! Keep up the great work! Learned a lot!
November 27th, 2006 at 1:41 pm
[…] 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. […]
April 14th, 2007 at 6:11 am
Awesome! For those of us without work colleagues to learn things off, your screen casts provide some much appreciated relief!
I was able to pick up some neat JS tips and tricks from your code, and it also helped reinforce good practices and design, as well as learning the main stuff :)
Cheers
November 28th, 2007 at 6:36 am
Thanks Dustin, I’m really enjoying this series. It’s so great to see the code develop, together with your thoughts and reasons for doing things this way or that.
Thanks again.