[dojo-contributors] Re: dojo.lang.inherits

Bill Keese bill at dojotoolkit.org
Fri Apr 7 21:31:34 EDT 2006


+1

We are talking about the syntax below, right?

dojo.declare("subclass", superclass,
{ constructor: ..., param1: ..., func1: ... });

This declares a class (or whatever word you want to use) called subclass 
that delegates to (ie, inherits from) superclass.

subclass is extended to contain the given parameters and functions, 
including a special function called "constructor". (IE: the specified 
parameters and functions are added to subclass' prototype)

subclass.constructor is called whenever you do "new subclass()" but not 
by calling:

    dojo.declare("classDerivedFromSubclass", subclass, ...);

Bill

Eugene Lazutkin wrote:
> Sandro Magi wrote:
>>
>> In an effort to avoid overloaded words, how about:
>>
>> dojo.declare(...)
> 
> Looks good. +1.
> 
> Thanks,
> 
> Eugene
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors

-- 

Bill



More information about the dojo-contributors mailing list