Skip to main content

StorageStrategy (Class Keyword)

Specifies which storage definition controls persistence for this class. Applies only to persistent and serial classes.

Usage

To specify which storage definition the class uses, use syntax like the following:

Class MyApp.MyClass Extends %Persistent [ StorageStrategy = MyStorage ] 
{ //class members }

Where MyStorage is the name of a storage definition in this class.

Details

This keyword specifies which storage definition is used to define the storage structure used by this class.

Typically you do not worry about this keyword or about storage structures; the class compiler will automatically define a storage structure named Default and maintain it (add new fields as appropriate) for you. It is possible to create more than one storage definition for a class. In this case, this keyword is used to specify which storage definition the class compiler should use.

Effect on Subclasses

This keyword is inherited from the primary superclass. The subclass can override the value of the keyword.

Default

If you omit this keyword, the persistence for this class is defined by the default storage definition, named Default.

See Also

FeedbackOpens in a new tab