Before proceeding further with the example we will create some persistence support. This will enable us to illustrate the features of the home collection class, the support for transactions within ObjectExtender, and to start building views. Good object-oriented applications should be separated into layers and the persistence layer has the knowledge to store our business objects ( that is, make them persistent ) as well as do lookups for us against the store.
The persistence support classes we will generate will enable us to store objects locally within our image. This helps to iterate over the model schema and the model classes and to build working views to get the application as far along as possible without having to think about the issues associated with mapping the business objects to a relational data store.
To generate the persistence support that will enable us to do local image persistence, do the following:
The persistent support classes are generated into the application, TstUniversityServicesApp.
The following classes will be generated:
The data objects that support the businesss objects will be stored in the image, and saved when the image is saved. To clear out these objects, and start from an empty set of objects, evaluate the following code:
ImageServiceObject reset.
Before working with objects in the model, the data store must be activated. To continue, evaluate the following code:
TstUniversityDataStore singleton activate.
Because we generated the schema for local image persistence, the superclass of TstUniversityDataStore is LocalImageDataStore which will use the image as the mechanism for persistence.