Difference between revisions of "Transient Attributes"

(New page: 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: deta...)
 
Line 1: Line 1:
 
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:
 
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:
  
 +
<e>
 
  field: detachable X
 
  field: detachable X
 
   note
 
   note
Line 6: Line 7:
 
   attribute
 
   attribute
 
   end
 
   end
 +
</e>
  
 
== Validity Rule ==
 
== Validity Rule ==
 
An attribute can be marked `volatile' if and only if its type has a default value and if the enclosing class is not expanded.
 
An attribute can be marked `volatile' if and only if its type has a default value and if 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.

Revision as of 14:37, 23 June 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 its type has a default value and if 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.