JOOT - JavaScript Object-Oriented Tools

Discussion in 'Javascript' started by Aleksey Zhendi, May 26, 2011.

  1. Description:
    JOOT is a small JavaScript library that provides convenient and
    simple API designed for sole purpose: to simplify creation of the
    object-oriented code.

    Project URL:
    http://code.google.com/p/joot/

    Features:
    * Narrow purpose. No redundant API.
    * Simple and convenient API.
    * Fully based on the ECMAScript specification (ECMA-262 3rd edition).
    * Respects ECMAScript 5 "strict mode".
    * No environment-specific code.
    * No external library dependencies.
    * Does not modify native objects.
    * Minimum probability of name conflicts. Adds only a single property
    to the global context.
    * Small size.
     
    Aleksey Zhendi, May 26, 2011
    #1
    1. Advertising

  2. On May 26, 1:57 pm, Aleksey Zhendi <> wrote:
    > Description:
    >    JOOT is a small JavaScript library that provides convenient and
    > simple API designed for sole purpose: to simplify creation of the
    > object-oriented code.
    >
    > Project URL:
    >    http://code.google.com/p/joot/
    >
    > Features:
    >  * Narrow purpose. No redundant API.
    >  * Simple and convenient API.
    >  * Fully based on the ECMAScript specification (ECMA-262 3rd edition).
    >  * Respects ECMAScript 5 "strict mode".
    >  * No environment-specific code.
    >  * No external library dependencies.
    >  * Does not modify native objects.
    >  * Minimum probability of name conflicts. Adds only a single property
    > to the global context.
    >  * Small size.


    Yet another "OO" library.

    For easier review/consumption, could you provide an example of how
    your library would implement this:

    function Animal(){}
    function Cat(){}
    Cat.prototype = Object.create(Animal.prototype);
    Cat.prototype.constructor = Cat;
    Cat.prototype.myExtendedMember = function(){
    return "foo";
    }

    While maintaining the appropriate constructor and instanceof
    relationships.

    -----------------------------

    Does/can it handle private variables with inherited methods that have
    access to them?

    -----------------------------

    Does it make it simpler to declare "static" variables?
     
    Michael Haufe (\TNO\), May 26, 2011
    #2
    1. Advertising

  3. On May 26, 11:48 pm, "Michael Haufe (\"TNO\")"
    <> wrote:
    > On May 26, 1:57 pm, Aleksey Zhendi <> wrote:
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > > Description:
    > >    JOOT is a small JavaScript library that provides convenient and
    > > simple API designed for sole purpose: to simplify creation of the
    > > object-oriented code.

    >
    > > Project URL:
    > >    http://code.google.com/p/joot/

    >
    > > Features:
    > >  * Narrow purpose. No redundant API.
    > >  * Simple and convenient API.
    > >  * Fully based on the ECMAScript specification (ECMA-262 3rd edition)..
    > >  * Respects ECMAScript 5 "strict mode".
    > >  * No environment-specific code.
    > >  * No external library dependencies.
    > >  * Does not modify native objects.
    > >  * Minimum probability of name conflicts. Adds only a single property
    > > to the global context.
    > >  * Small size.

    >
    > Yet another "OO" library.
    >
    > For easier review/consumption, could you provide an example of how
    > your library would implement this:
    >
    > function Animal(){}
    > function Cat(){}
    > Cat.prototype = Object.create(Animal.prototype);
    > Cat.prototype.constructor = Cat;
    > Cat.prototype.myExtendedMember = function(){
    >     return "foo";
    >
    > }
    >
    > While maintaining the appropriate constructor and instanceof
    > relationships.
    >
    > -----------------------------
    >
    > Does/can it handle private variables with inherited methods that have
    > access to them?
    >
    > -----------------------------
    >
    > Does it make it simpler to declare "static" variables?


    1) Yes of course:

    var Animal = joot.createClass();

    var Cat = joot.createClass( {
    $parent: Animal,
    myExtendedMember: function() {
    return 'foo';
    }
    } );

    var x = new Cat();

    console.log( x instanceof Animal ); // true
    console.log( x instanceof Cat ); // true
    console.log( x.constructor === Cat ); // true

    2) JOOT emulates inheritance by linking classes prototypes.
    To emulate true private properties\methods we must declare them in the
    constructor function with 'var' statement.
    So they are stored in a closure, not in the class prototype.
    So the answer is no.

    3) Although it can be easily implemented, for now there is no any
    'sugar' for it.
     
    Aleksey Zhendi, May 26, 2011
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Hathaway
    Replies:
    0
    Views:
    424
    Robert Hathaway
    Jul 29, 2003
  2. Robert Hathaway
    Replies:
    0
    Views:
    424
    Robert Hathaway
    Jul 29, 2003
  3. Robert Hathaway
    Replies:
    1
    Views:
    464
    Robert J Hathaway III
    Jul 29, 2003
  4. Replies:
    2
    Views:
    438
    Bruno Desthuilliers
    May 26, 2008
  5. rolo
    Replies:
    3
    Views:
    189
    Robert Klemme
    Apr 9, 2004
Loading...

Share This Page