java.lang.reflect
).
The RTTI are a metamodel that is close to the
java.lang.reflect
metamodel but more precise (actually
it wraps it and adds some extra informations).
It allows the programmer to easily build some informations that can be useful for other aspects such as the Persistence or the Gui aspects. Typically, these aspects may want to access some more precise informations about which fields are read or written by a given method (so that they can decide to update the object storage or the object view).
The access point to the runtime informations is
ClassRepository
that allows the client program to
retrieve ClassItem
instances, where the informations are
stored.
A sample configuration of the RttiAC aspect can be:
// rtti.acc file // define a virtual type newVirtualClass text; // tell that some field are from this type setFieldType jac.samples.contacts.Contact notes text; setFieldType jac.samples.contacts.Company notes text; // the calcul class have methods that modify the // objects states but, since they do not follow any // naming conventions, we need to declare them class jac.samples.calcul.Calcul { addWrittenFields add { "value" }; addWrittenFields sub { "value" }; } // say that the contacts collection must be cloned when // an instance of FilteredContacts is cloned setClonedFields jac.samples.contacts.FilteredContacts {contacts};