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

## Class MVCModel

    Object
       |
       +--GrvObject
             |
             +--MVCObserver
                   |
                   +--MVCModel

Direct Known Subclasses:
  MVCScalarModel, MVCListModel, MVCMapModel, EDOHolderModel

class MVCModel
extends MVCObserver

This abstract class acts as the base class for each MVC data model; Since models can subscribe to other models, they can act as both MVCObserver and MVCObservable. This class implements the MVCObservable interface.
Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
Defined in grvMVC.js

Constructor Summary
`MVCModel ()`

Method Summary
`void` | `_SET(property,value)` generic "bean" property SETTER (w/o publish)
`void` | `addObserver( observer )` MVCObservable API
`void` | `BeginTransaction()` inhibit publishing until matching EndTransaction() called
`void` | `clean()` clear the "dirty" flag that says "there has been a change to this model since the last update event broadcase via publish()"
`void` | `delObserver( observer )`
`void` | `dirty()` set the "dirty" and "everChanged" flags to true
`void` | `dumpSubscribers()` debug method generating alert with subscriber list
`void` | `EndTransaction(<boolean> totalReload)` publish a "batch" of updates
`Object` | `GET(property )` generic "bean" property GETTER
`void` | `konstructor( <String> optName )`
`void` | `neverChanged()` return current value of funky "everChanged" flag
`void` | `notifyObservers( <Object> optAdhocObj )` if "dirty" flag is set, Notify all subscribers of change to our state; When done, if we were the initiator of the cascade of update events (ie if global transaction depth is back to zero when we are done), then the views will be redrawn.
`void` | `publish( <boolean> resetMark, <Object> optAdhocObj )` tell observers that we have changed
`void` | `reloaded()` handle "Model reloaded" event.
`boolean` | `SET(property,value)` generic "bean" property SETTER (w/publish)
`String` | `toString()` return "this" formatted as string
`void` | `updateStamp()` update the timestamp on this model

Methods inherited from class MVCObserver
`update, subscribe`

Methods inherited from class GrvObject
`souper, souper_, isInstanceOf`

Constructor Detail

### MVCModel

    MVCModel()

Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)

Method Detail

### _SET

    void _SET(property,value)

generic "bean" property SETTER (w/o publish)

### addObserver

    void addObserver( observer )

MVCObservable API

### BeginTransaction

    void BeginTransaction()

inhibit publishing until matching EndTransaction() called

### clean

    void clean()

clear the "dirty" flag that says "there has been a change to this model since the last update event broadcase via publish()"

### delObserver

    void delObserver( observer )

Deprecated
Throws:

- not implemented exception

### dirty

    void dirty()

set the "dirty" and "everChanged" flags to true

### dumpSubscribers

    void dumpSubscribers()

debug method generating alert with subscriber list

### EndTransaction

    void EndTransaction(<boolean> totalReload)

publish a "batch" of updates

Parameters:

`totalReload` - clears "everChanged" flag iff true

### GET

    Object GET(property )

generic "bean" property GETTER

### konstructor

    void konstructor( <String> optName )

Parameters:

`optName` - optional name of this instance

### neverChanged

    void neverChanged()

return current value of funky "everChanged" flag

### notifyObservers

    void notifyObservers( <Object> optAdhocObj )

if "dirty" flag is set, Notify all subscribers of change to our state; When done, if we were the initiator of the cascade of update events (ie if global transaction depth is back to zero when we are done), then the views will be redrawn.

Parameters:

`optAdhocObj` - optional adhoc object passed to observers

### publish

    void publish( <boolean> resetMark, <Object> optAdhocObj )

tell observers that we have changed

Parameters:

`resetMark` - if true clear funky "everChanged" flag

`optAdhocObj` - optional adhoc object to pass to observers

### reloaded

    void reloaded()

handle "Model reloaded" event.

### SET

    boolean SET(property,value)

generic "bean" property SETTER (w/publish)

Returns:

flag saying if we published

### toString

    String toString()

return "this" formatted as string

### updateStamp

    void updateStamp()

update the timestamp on this model

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

Documentation generated by JSDoc on Sun Feb 11 13:28:59 2007