Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not exactly sure what you are looking for, but my current framework allows you to program in OO fashion like so:</p> <pre><code>Cin.define({ name: 'MyApp.Logger', extends: 'Cin.Component', implements: ['MyApp.ILogger'], mixes: { SomeMixin: 'MyApp.SomeMixin' }, init: function() { }, method: function() { }, statics: { staticMethod: function() {} } }); </code></pre> <p>And then you can write code like:</p> <pre><code>var instance = new MyApp.Logger(); instance.method(); MyApp.Logger.staticMethod(); </code></pre> <p>I am not trying to <em>emulate</em> classical OO here. I am trying to make a convenient and useful way to declare inheritance, mixins, interfaces, and general OO concepts so that it becomes easy for the developer to write such OO code. This also gives me the chance to finish my auto loading component so that you no longer take care of dependencies and you can make custom builds and enjoy faster development thanks to not needing to load 100 scripts per each page load.</p> <p>If you want to learn prototypical OO concepts, I think you should write some kind of inheritance system. Take a look at <a href="http://dojotoolkit.org/" rel="nofollow">Dojo Toolkit</a> or <a href="http://extjs.com" rel="nofollow">ExtJS</a>. A good thing to remember is that Prototype-based systems twist and mangle, they are more powerful than Class-based OO languages. In my opinion, there is no single right way to write prototypal code.</p> <p>I'm afraid though that most if not all inheritance systems might look like they emulate classical OO. In my opinion, my framework does not, but then it's not even finished.</p>
 

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