Class GrvObject
Object
|
+--GrvObject
-
Direct Known Subclasses:
-
MVCContext, EDOHolderSelectionItem, MVCDecode, MVCMutex, MVCEditRule, EDOIndex, MVCObserver, MVCMap, MVCView, EDO, MVCCommand
- class
GrvObject
This is the root class for all "classes" implemented
via the GLOBALS.Class() function (ala Java "Object").
Class replaces the normal Javascript "constructor" function
with a new wrapper function that implements a robust
inheritence mechanism.
This mechanism supports "pretty" source code whereby
"methods" are declared inline, but the source code of
those methods are not copied into every object instance
as would otherwise be the case.
The wrapper function also sets up a real "constructor"
that can use GLOBALS.grvValidateArgs() to insure
that the required parameters are passed to it, throwing
an exception if not.
The design pattern implemented by Class/Extends corrects
several problems that occur with the naive inheritence
mechanisms often used with Javascript.
The required coding convention for "GrvObject":
(1) the "class" is declared via the utility
function GLOBALS.Class()
(2) the "superclass" (if any) is declared via the
.Extends method GLOBALS.grvExtends()
(3) the "constructor" logic for the class is placed
in a "method" named "konstructor"
(4) the konstructor method invokes the "super" constructor
via its class name [rather than literally "super()"]
(5) "interfaces" and extra "superclasses" (if any) are
declared via the .Implements method GLOBALS.grvImplements()
Version: 2.2
Author: Bruce Wallace (PolyGlotInc.com)
See:Defined in grvClasses.js
|
Method Summary |
Object
|
isInstanceOf( <Function> aClass )
Is "this" a descendent of the given class?.
|
Object
|
souper()
Invokes the "super" version of whatever method that is calling souper.
|
Object
|
souper_( superclass )
Invokes the version of whatever method that is calling souper_ from
the specified superclass.
|
GrvObject
GrvObject()
Version: 2.2
Author: Bruce Wallace (PolyGlotInc.com)
See:Throws:- grvMissingArgException thrown by constructor wrapper
isInstanceOf
Object isInstanceOf( <Function> aClass )
Is "this" a descendent of the given class?.
This implementation works with Gravey's multiple inheritence.
Parameters:
aClass - the class to verify
Returns:
true iff "this" is an "instanceof" aClass
souper
Object souper()
Invokes the "super" version of whatever method that is calling souper.
Returns:
either the return value of the super method or null if no super exists
souper_
Object souper_( superclass )
Invokes the version of whatever method that is calling souper_ from
the specified superclass.
Returns:
either the return value of the super method or null if no super exists
Documentation generated by
JSDoc on Sun Feb 11 13:28:59 2007