Storing object types mature
On file systems, file name extensions are used to define the type of a file. In addition, many file formats write a magic number somewhere close to the beginning of the file, allowing them to be recognized by reading the first few bytes.
Condensation does not store any type along with an object. Type information is supposed to be stored (implicitly or explicitly) in the parent object.
Since objects are encrypted, it would not make a lot of sense to store type information with the object itself, because:
- Leaving the object type unencrypted may leak information about the content.
- Encrypting the object type would make it accessible through the parent object (which contains the encryption key) only. Hence, type information can be stored in the parent object as well.
The type of root objects, i.e. objects with an envelope as parent, is given by the box type:
- The message box always contains envelopes referencing a message record. Message records must implicitly or explicitly specify the message type.
- The content of the private box is appplication specific. Since this box is always used by the same application, there is no need to store explicit type information.
- The public box always contains an envelope referencing a public card.