Download GemBuilder for Smalltalk

Transcript
Sharing Objects
Replicates
replicate — faults in the instance variable as a replicate whose behavior will be
subject to the configuration parameters faultlevelRpc and
faultLevelLnk, relative to the root object being faulted.
By default, an instance variable’s behavior is replicate; your application
needn’t specify replicates unless to restore behavior overridden in a superclass.
Example 3.6
TestObject class>>replicationSpec
^super replicationSpec ,
#(
(instVar1 stub)
(instVar2 forwarder)
(instVar3 max 0)
(instVar4 min 0)
(instVar5 max 2)
(instVar6 min 2)
(instVar7 replicate)
(indexble_part min 1) )
NOTE
To ensure that your replication spec is respected, do not rely on
automatic class generation to replicate instances of classes for which you
have defined replication specs. Instead, make sure these classes are
connected before your application tries to access the corresponding server
objects. Automatic class generation ignores replication specifications.
Replication Specifications and Class Versions
As explained in “Mapping and Class Versions” on page 3-8, client Smalltalk
classes connect not simply to GemStone Smalltalk classes, but to specific
GemStone class versions. A class connector connects to at most one GemStone
version.
A replication spec, therefore, affects only client instances connected to instances of
the correct GemStone class version.
Suppose, for example, that you define and redefine class X in GemStone until its
class history lists three versions. Your client Smalltalk class is connected to
Version 2. Class X’s replication spec will affect GemStone instances of Class X,
Version 2. If the repository contains instances of Class X, Versions 1 or 3, the
replication spec will not affect them.
December 2001
GemStone Systems, Inc.
3-23