Note that there are some explanatory texts on larger screens.

plurals
  1. PO(Open Source) Examples of JavaScript Prototypical OO
    primarykey
    data
    text
    <p><strong>Bounty Edit:</strong></p> <p>I'm looking for code written in a <em>pure</em> prototypical OO paradigm (think Self). Not a mixture of prototypical OO and classical OO. I don't want to see generic OO wrappers but simply usage of prototypical OO techniques and <em>only</em> prototypical OO techniques.</p> <p><strong>Reference Related Question:</strong></p> <p><a href="https://stackoverflow.com/questions/6526241/prototypical-oo-in-javascript">Prototypical OO in JavaScript</a></p> <p>In the above question I mainly focused on </p> <blockquote> <p>Can write prototypical OO like this?</p> <p>Do we need constructors and initialization logic, What are the alternatives?</p> </blockquote> <p><strong>New question:</strong></p> <p>Basically are there any <em>good examples of javascript prototypical</em> OO in large open source projects?</p> <p><strong>Clarification:</strong></p> <p>I will have to clarify what I mean with <strong>prototypical OO</strong> :</p> <ul> <li>There are no classes. There are only Objects.</li> <li><strong>There is <em>zero</em> emulation of the concepts of classes,</strong> again there is only objects and cloning objects to create new objects.</li> </ul> <p><strong>Further Clarification of Prototypical OO:</strong></p> <p>The difference between prototypical OO in JavaScript and classical OO emulation is a <em>very grey area</em>. It's not that I <em>value</em> avoiding classical OO. I want to learn prototypical OO in an academic fashion in it's own right, without learning the (probably more optimum) combination of classical OO emulation and prototypical OO.</p> <p>This is why I "ban" classes, just so that I can see these techniques in a pure fashion and extend my own OO tool kit. </p> <p><strong>Examples:</strong></p> <p>Popular examples like jQuery fail to meet the second criteria. The <code>jQuery</code> object is one big class emulation. It focuses on creating new objects from a class rather then cloning existing objects. </p> <p>If I actually knew any example of using <em>"pure"</em> prototypical OO I would have shown you. I believe 99% of JavaScript OO is too heavily influenced by classical emulation.</p> <p><strong>Bonus points</strong> </p> <p>If </p> <ul> <li>It's well comented / documented</li> <li>Has unit tests</li> <li>Is on github.</li> </ul> <p>I will also accept articles / tutorials and examples on how to write prototypical OO code that goes beyond your trivial hello world application.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. COI read your previous q yesterday and the discussion, and I am very interested in this discussion. But I still don't understand something fundamental here. Why do you consider adding methods to a "class" to be impure? What exactly is the distinction you are seeking between prototypical and class-based OO? Cloning an object and adding new methods/members is part of the design of the prototype construct. Just because this happens to be functonally similar to class-based inheritance, why isn't this a legitimate part of a "prototypical" design? What benefits do you seek by avoiding this construct?
      singulars
    2. COMaybe you could have a look at this : http://plugins.jquery.com/project/classBuilder This is not exactly what your are looking for, and thus not an answer, but still interesting in the current topic.
      singulars
    3. CO@jamietre the distinction is very very _grey_ and I see that it's a problem. The problem lies in that I know classical OO. It's not a matter of wanting to avoid classical OO but rather a matter of wanting to learn prototypical OO (without spending a few weeks learning Self). The main problem lies that there is very little academic information on _pure_ prototyical OO in JavaScript. I hope the edit to the question clarifies this. I seek to learn pure concepts so I can combine them together with current OO techniques properly.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload