with Imagination: by Dustin Diaz

./with Imagination

A JavaScript, CSS, XHTML web log focusing on usability and accessibility by Dustin Diaz

Screencast 03: Developing an Object Oriented Web Service

Saturday, September 16th, 2006

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)

24 Responses to “Screencast 03: Developing an Object Oriented Web Service”

  1. Michal Hantl

    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:).

  2. David Caunt

    I second the torrent idea as the screencasts get bigger every time (not a bad thing though!)

  3. Jesper Haug Karsrud

    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!

  4. tim.b

    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 !

  5. Dustin Diaz

    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 :)

  6. Dustin Diaz

    @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?

  7. Dustin Diaz

    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 :)

  8. C

    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

  9. Kalle

    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!

  10. Dustin Diaz

    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.

  11. Jesper Haug Karsrud

    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 :)

  12. Dan Sorensen

    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.

  13. Bramus!

    Rather long screencast, yet worth the time spent! Didn’t get bored at any time.

    “Today I have learned…”

    Thanks Dustin!

  14. dcaunt

    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

  15. Dustin Diaz

    Dcaunt, you may wish to redownload the 53Mb version - mainly because it has sound that is output to both of your speakers.

  16. johnL

    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.

  17. adam reitsma

    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!

  18. Dustin Diaz

    @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.

  19. Michal Hantl

    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;)

  20. Hermann Klinke

    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!

  21. Rommel Caibal

    Just watching you code effortlessly is a treat!! Keep up the great work! Learned a lot!

  22. Developing an Object Oriented Web Service :: Tech Videos, Screencasts, Webinars

    […] 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. […]

  23. Charlie

    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

  24. Stuart

    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.

Leave a Reply

Phone Number:

If you're about to post code in your comment, please wrap your code with the tag-combo <pre><code>. Also please escape your html entities - otherwise they will be stripped out. I recommend using postable.

Get "JavaScript Design Patterns"

"As a web developer, you'll already know that JavaScript™ is a powerful language, allowing you to add an impressive array of dynamic functionality to otherwise static web sites. But there is more power waiting to be unlocked--JavaScript is capable of full object-oriented capabilities, and by applying OOP principles, best practices, and design patterns to your code, you can make it more powerful, more efficient, and easier to work with alone or as part of a team."

Buy JS Design Patterns from Amazon.com Buy JS Design Patterns from Apress

Flickr

Submit a Prototype

All content copyright © 2003 - 2007 under the Creative Commons License. Wanna know something? Just ask.

About | Archives | Blog Search

[x] close

Loading...

Submit a prototype

By checking this prototype I agree that I am not submitting false credentials, pornography, or a hate crime website. I also understand that by submitting my entry I may or may not be accepted, and if accepted, my entry may be taken down at any given time if I violate these terms.