Supporting a new version of the model

Finally, in this step a new version of the class TTilesModel is created. At this point, you need to support versioning of the TTilesModel class (and not TTilesView or TTilesSelection) because a TTilesModel object is the only thing saved when you close a Tiles document component. By creating a second version of TTilesModel--and supporting streaming in instances of the original version of TTilesModel-- you can compile the Tiles project code for this step and still open documents created with earlier versions of TTilesModel.

To support both versions, all you have to do is provide specific support for streaming in either version in the model's input streaming operator (operator <<=). For TTilesModel, the only difference is that the streaming operator is called on a different parent class depending on the version being streamed in.

You can now create a Tiles document and see the new functionality by compiling the project in the directory $TaligentRoot/TaligentSamples/Supported/Apps/TilesTutorial/07.Embedding/Tiles and then calling TilesTutorialApp from the $TaligentSharedLibs directory. Make sure that a previous version of a Tiles document is not running when you compile the project.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker