SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    815
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Applying OOP principles to jQuery

    some job descriptions now include:

    [quote]Applying OOP principles to jQuery development[quote]

    would appreciate being enlightened here a bit.. I'm very good with DOM-scripting with jQuery.. and also have basic OO, but would love to see some elaboration here, maybe code samples...

    thank you...

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,259
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    I don't think I would be quite sure what this employer was looking for either. jQuery of course manipulates lots of objects, especially DOM objects, but the vast majority of jQuery code is written in a procedural style. There's no object type hierarchy or composition. There's just the one, monolithic jQuery object type. Not even jQuery.extend does prototypal inheritance. It actually just copies properties from one object into another.

    If you want to see what real OOP principles looks like, you should check out other libraries such as YUI, Dojo, or ExtJS.
    "First make it work. Then make it better."

  3. #3
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,259
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Though, I suppose it's likely that the employer used the word "jQuery" as if it were a synonym for "JavaScript". In which case he's actually asking about OOP principles in JavaScript.

    Some resources about JavaScript OOP that might help:

    http://eloquentjavascript.net/chapter8.html

    https://developer.mozilla.org/en-US/...ted_JavaScript
    "First make it work. Then make it better."

  4. #4
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    815
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    yes I thought someone would say something like this...

    (yes they could be referring to plain JS instead of jQ, like other responder said, but if it's a job description for a web developer one would think they'd get the terminology correct, right? ;~))


    Quote Originally Posted by Jeff Mott View Post
    I don't think I would be quite sure what this employer was looking for either. jQuery of course manipulates lots of objects, especially DOM objects, but the vast majority of jQuery code is written in a procedural style. There's no object type hierarchy or composition. There's just the one, monolithic jQuery object type. Not even jQuery.extend does prototypal inheritance. It actually just copies properties from one object into another.

    If you want to see what real OOP principles looks like, you should check out other libraries such as YUI, Dojo, or ExtJS.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •