Difference between revisions of "Transient Attributes"

m (Volatile Attributes moved to Transient Attributes: Better naming of mechanism)
(No difference)

Revision as of 07:19, 6 July 2009

For storable purposes, it makes sense that some attributes of objects are not stored to disk. We call them volatile attribute and currently are specified using a note clause:

field: detachable X
   note
     option: volatile
   attribute
   end

Validity Rule

An attribute can be marked `volatile' if and only if:

  1. its type has a default value (i.e. it cannot be a formal or an attached type)
  2. it is not a user defined expanded type
  3. the enclosing class is not expanded

Rationale of validity rule

If the type did not have a default value (which is the case for attached types), then upon retrieval the volatile attribute would be Void which is against void-safety.

For simplicity and backward compatibility of `basic_store' which does a memory copy of the object to disk, it would be quite complicated to implement when expanded are involved. We prefer our users to use SED once it supports expanded.

Semantic

The volatile property of an attribute declared in a class A keeps its volatile property in descendants of A unless the attribute is redefined.