Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > JOOT - JavaScript Object-Oriented Tools

Reply
Thread Tools

JOOT - JavaScript Object-Oriented Tools

 
 
Aleksey Zhendi
Guest
Posts: n/a
 
      05-26-2011
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.
 
Reply With Quote
 
 
 
 
Michael Haufe (\TNO\)
Guest
Posts: n/a
 
      05-26-2011
On May 26, 1:57*pm, Aleksey Zhendi <(E-Mail Removed)> 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?
 
Reply With Quote
 
 
 
 
Aleksey Zhendi
Guest
Posts: n/a
 
      05-26-2011
On May 26, 11:48*pm, "Michael Haufe (\"TNO\")"
<(E-Mail Removed)> wrote:
> On May 26, 1:57*pm, Aleksey Zhendi <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
Article : Security Tools Part -- 2 (.Net FrameWork Tools Series) Namratha Shah \(Nasha\) ASP .Net 0 11-23-2004 04:01 PM



Advertisments