|
Metastorage class variables feature enhancements
Manuel Lemos, 2004-09-16 04:30:00 GMT
A new version of Metastorage was released providing several new
features that are mostly enhancements of the capabilities of the data
object class variables.
Most of the implemented enhancements correspond to feature requests, some
made many months ago. Here is a list of the most relevant:
- Optional variables
Variables may be defined to be either optional or required. This means that
a variable that is not initialized is stored as NULL, but this is
usually inefficient and often not useful. Since this release all variables
are required by default but can be defined explicitly as optional.
Attempts to store objects with required variables that are not initialized
will result in a runtime error, as it is most likely due to an
inconsistency bug in the application. This way Metastorage helps to detect
bugs that otherwise would go unnoticed.
- Variable initial values
Variables may now have assigned an initial value. This value is also used
as default for the respective database table column. When a new variable is
added, existing objects will have that variable column assigned to the
specified initial value.
- Automatically assigned date and time variables
Some types of variables may be defined to be automatically assigned to
special values right before when the objects are stored. The variables may
be either autocreate (assign only when the objects are created and
never change) or autoupdate (assign every time the objects are
updated).
Currently, only variables of date and time types may be automatically
assigned this way. They may be set to the current date and time of either
the local time zone or UTC (Universal Time).
This feature is useful for applications that need to keep track of when the
objects of certain classes are created or were updated for the last time.
This way, the developers do not need to write additional code for every
class that needs this feature.
- Length limited text variables
Text variables may have now an explicit text length. This is an enhancement
meant to provide more efficiency to the storage of text variables that are
known to not need more space than a given limit.
- Class element identifiers
Variables, classes and other types of elements may have assigned an
optional unique identifier value.
Currently, Metastorage does not make any use of these identifiers. They are
meant mostly to assist in import and export operations that allow separate
tools to exchange components defined in the Metastorage format for external
editing, like for instance UML design tools.
Regarding the generated code, the most important new feature is the
possibility to
assign
or retrieve the database connection handle that is used by the
generated classes to store and retrieve the persistent objects.
This feature is convenient to applications that integrate more than one
component generated by Metastorage, or applications that have already
initialized the database connection before accessing the generated
classes, thus avoiding to initialize the database connection more than
once. |
|