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
      |
      +--GraphColumn
      |
      +--HTTPServerSettingsAppl::PluggableServicesSettingsAppl::AvailableServiceItem
      |
      +--Menu
      |
      +--Plug
      |
      +--SelectionInHierarchy
      |
      +--SelectionInTree
      |
      +--TabItem
      |
      +--TabulatorSpecification
      |
      +--Tools::Inspector2::NavigationState
      |
      +--ValueModel

Package:
stx:libview2
Category:
Interface-Support-Models
Version:
rev: 1.56 date: 2022/07/10 13:57:24
user: cg
file: Model.st directory: libview2
module: stx stc-classLibrary: libview2

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.

copyright

COPYRIGHT (c) 1992 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

queries
o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

converting
o  skippedInLiteralEncoding
define the inst-slots which are skipped when generating a literalArrayEncoding;
(to skip the ones with default values.)

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

copying-private
o  postCopy
release dependents after copying

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.
Iterate over a copy, so tha aBlock may remove 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:

encoding & decoding
o  skippedInJSONEncoding
( an extension from the stx:goodies/communication package )
return the names of inst-slots which are to be skipped when generating a jsonEncoding;
(to skip the ones with default or irrelevant values.)

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:23:36 GMT