tags:

views:

85

answers:

3

Hi,

Can anyone point me in the right direction of some real world object-orientated javascript? I'm learning OO for javascript from a few books but all the examples given in these books boil down to the dog object inheriting from the animal prototype or similar. I really want to see something a bit more substantial.

I've looked at jQuery and similar libraries (base, prototype) but I consider them to be verbose examples. I was looking for a script where I can see inheritance in use (classical or protoypal) clearly.

A: 

See source of jQuery or any of its plugins.

CommanderZ
Most of jQuery plugins are hardly coding masterpieces... =)
Jani Hartikainen
+3  A: 

Good "real world" examples to learn OO javascript is to actually study some of the javascript frameworks out there. Some of them support and use OO within their own framework code:

These provide great reference and various strategies for writing OO javascript.

naikus
Hi- thanks for the reply. Just downloaded YUI and compared to looking at the jQuery library code it's very clear how the library is working...I can see Crockfords object() function for inheritance in there as well
elduderino
@elduderino I learned a lot from YUI looking early versions yui too. All these frameworks are great to study some neat tricks in javascript! And doug Corckford's links on javascript are gold!
naikus
+1  A: 
Gabi Purcaru
Yeah that works for me. The concepts prototype, pseudo-classical and prototypal are clear to me but I'm just having problems seeing how to introduce it in to my own code.
elduderino