Overview | File | Class | Tree | Index | Help
| The Gravey 2.5 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:

- GLOBALS.Class()
- GLOBALS.grvExtends()
- GLOBALS.grvImplements()

Defined in grvClasses.js

Constructor Summary
`GrvObject ()`

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.

Constructor Detail

### GrvObject

    GrvObject()

Version: 2.2
Author: Bruce Wallace (PolyGlotInc.com)
See:

- GLOBALS.Class()
- GLOBALS.grvExtends()
- GLOBALS.grvImplements()

Throws:

- grvMissingArgException thrown by constructor wrapper

Method Detail

### 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

Overview | File | Class | Tree | Index | Help
| The Gravey 2.5 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Jan 6 12:47:09 2011