Missing Alternate TagMissing Alternate TagMissing Alternate TagMissing Alternate TagMissing Alternate TagMissing Alternate TagMissing Alternate TagMissing Alternate Tag

SIXX 0.2 Release Note


Improvements:


SIXX Hooks:

Customizing serialization
Object>>sixxPrepareWriteIt is called before the instance is written in SIXX.
Object>>sixxWriteValueReturn the object actually serialized.
Object>>sixxIgnorableInstVarNamesSpecify the instance variables that are not written in SIXX

Customizing deserialization
Object>>sixxInitializeIt is called immediately after the instance is read from SIXX
Object>>sixxReadValueReturn the object for the client from the read instance.

It became easier to implement the Memento pattern by sixxWriteValue and sixxReadValue. The user can read and write the object without considering using Memento at all.

Shape change support:

SixxShapeChangeReadStream enables you to read class shape changed instances. It supports renamed, removed and newly added instance variables.


srs := SixxShapeChangeReadStream on: oldSixx readStream.
srs shapeChangers at:#SmallIntegerOLD put: SmallInteger . "simple renaming"

srs shapeChangers at: #SixxShapeChangedObject put: SixxMockShapeChanger.
"You can implement ShapeChanger for more complex conversion. "


Here is an excerpt of the comment of ShapeChanger.

Basically, you should subclass me and override three methods.

(YourShapeChanger >> shapeChangedObjectClass)
Return a newly introduced class for old instances.

(YourShapeChanger >> sixxInstVarNamed: varName put: value)
Override this method for setting converted values to the shape changed object.
Example:
  "#oldNamedVar1 inst var was renamed to #renamedAtt1"
  varName == #oldNamedVar1 ifTrue: [^self attributesMap at: #renamedAtt1 put: value].

  "#oldNamedVar2 inst var was removed."
  varName == #oldNamedVar2 ifTrue: [^self].

  super sixxInstVarNamed: varName put: value

(YourShapeChanger >> initializeShapeChangedObject )
Override this method for setting newly introduced values to the shape changed object.


-----------

Links to this Page