Transient Metadata

Author:Tomas Zezula
Version:1.0
Note: The API described in this document is not an official contract and may change without preserving a backward compatibility. Such changes will be announced in advance on MDR mailing lists.

Intention

To provide model elements whose end of lifecycle is controlled by the JVM garbage collector in addition to the refDelete operation.

Motivation

The model of Java language needs to hold same temporary data which should not persist (e.g. JavaDoc, position in the source file,...). The Java module supplies references to this model elements to its clients, so it is hard for it to control their livecycle. The transient metadata provides elegant solution of this problem. The developer only marks the Class as transient during creation of model, modifies model to fullfill the requirements for transient metadata (described below) and imports the model into the MDR. The deletion of unreferenced elements is done automatically by the MDR engine.

Limitations

The tansient model elements have several limitations in comparison to the standard model elements.

Usage

The MDR engine treats the object as transient if its class has the org.netbeans.mdr.transient tag set to the value true. Such a class is represented by the TransientStorableClass rather than StorableClass. The TransientStorableClass creates TransientStorableObject for instance representation. The association is treated as transient automatically if at least one end of the association is transient (represented by transient class).