eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Model':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Model


Inheritance:

   Object
   |
   +--Model
      |
      +--ApplicationModel
      |
      +--HTTPServerSettingsAppl::PluggableServicesSettingsAppl::AvailableServiceItem
      |
      +--Menu
      |
      +--Plug
      |
      +--SelectionInHierarchy
      |
      +--SelectionInTree
      |
      +--TabItem
      |
      +--TabulatorSpecification
      |
      +--Tools::Inspector2::NavigationState
      |
      +--ValueModel

Package:
stx:libview2
Category:
Interface-Support-Models
Version:
rev: 1.45 date: 2018/03/28 12:43:32
user: cg
file: Model.st directory: libview2
module: stx stc-classLibrary: libview2
Author:
Claus Gittinger

Description:


Models are things which represent information models, i.e. something
which holds the data for user interface components and on which these operate.
Basically, instances keep track of which components depend on them and 
inform the dependents of any changes.

The Model class itself is abstract and not too useful, see subclasses,
especially, ValueHolder and SelectionInList.

Notice:
  Actually the Model class is not really needed; since the dependency
  mechanism is inherited by Object, you can take any object as a model.
  However, instances of Model (and subclasses) keep the dependents locally
  in an instance variable; thus speeding up access a bit.

  Model redefines the dependency methods to use non-weak dependencies
  (in contrast to weak dependencies used by Object).  

[Instance variables:]
    dependents      <Collection>    those objects which depend on me.
                                    To save some storage, a single dependent 
                                    is kept directly here.
                                    Otherwise, if there are multiple dependents,
                                    a collection of dependents is held here.


Related information:

    ValueHolder
    SelectionInList
    [introduction to view programming]

Class protocol:

queries
o  isAbstract


Instance protocol:

converting
o  skippedInLiteralEncoding
return a Collection with elements which are skipped in the encoding

copying
o  postCopy
release dependents after copying

o  skipInstvarIndexInDeepCopy: index
a helper for deepCopy; only indices for which this method returns
false are copied in a deep copy.

dependents access
o  addDependent: anObject
make the argument, anObject be a dependent of the receiver

o  breakDependents
remove all dependencies from the receiver

o  dependents
return a Collection of dependents

o  dependents: aCollectionOrNil
set the collection of dependents

o  dependentsDo: aBlock
evaluate aBlock for all of my dependents

o  removeDependent: anObject
make the argument, anObject be independent of the receiver

dependents access (non weak)
o  addNonWeakDependent: anObject
make the argument, anObject be a dependent of the receiver.
Since all dependencies are nonWeak in Model, this is simply
forwarded to addDependent:

o  interests
return a Collection of interests - empty if there is none.
Here, we use the normal dependents collection for interests.

o  nonWeakDependents
return a Collection of dependents - empty if there is none.
Since all dependencies are nonWeak in Model, this is a dummy.

o  removeNonWeakDependent: anObject
make the argument, anObject be independent of the receiver.
Since all dependencies are nonWeak in Model, this is simply
forwarded to removeDependent:

suppressing updates
o  isLocked
ask the updateLocked query.

o  withUpdatesLockedDo: aBlock
execute aBlock with updates to myself temporarily suppressed,
(i.e. by answering true to the updateLocked query)
This is a cooperative interface - i.e. possible updaters MUST
check me via isLocked, before sending #value

o  withoutSendingUpdatesDo: aBlock
execute aBlock with updates to dependents temporarily suppressed
(i.e. I will not notify the dependents during aBlock)
Warning:
do not change any dependencies inside the block,
as the original dependencies from before will be restored and such changes
are lost then.


Private classes:

    ModelUpdateLockedQuery


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Thu, 19 Jul 2018 06:10:18 GMT