Released Metastorage generator
Manuel Lemos, 2002-12-05 16:11:44 GMT
|Metastorage is an application that is capable of generating persistence
layer APIs. It takes a component definition defined in the Component
Persistence Markup Language (CPML), a
XML based format, and generates classes and storage schemas in a given
target programming language.
Using CPML, developers can focus their efforts on the modeling of data
structures that hold the information and the relationships between the
entities that their applications deal with. Metastorage takes care of
generating all the necessary code to store and retrieve such data
structures from persistent storage containers like relational databases.
The main goal of Metastorage is to drastically reduce the time to
develop applications that traditionally use on SQL based relational
The generated APIs consist of a sets of classes that provide an Object
Oriented interface to the objects of the classes modeled using CPML.
The generated APIs are also capable of installing the data schema in the
persistence container, which in the case of a relational database is the
set of tables that will hold the persistent objects. This completely
eliminates the need to write any SQL queries manually.
CPML is independent of the type of persistent container. This means
that while it can be used to model classes of persistent objects that may
be stored in relational databases, such objects may as well be stored in
other types of persistence containers.
For instance, if an application needs to move a directory of objects with
user information from a relational database to a LDAP server to increase
the application scalability, the same CPML component definition would be
used. Metastorage would then generate classes objects that implement the
same API for interfacing with a LDAP server that is compatible with the API
generated to interface with relational databases. This make the migration
process easier and with reduced risks.
Another possible benefit of the persistence container independence of the
APIs generated by Metastorage, is the case where an application may need to
run in environments where a SQL based database server is not available. In
that case the same API could be generated to store persistent objects in
flat file databases or plain XML files.
For now, the current version of Metastorage only supports the generation of
PHP code based on the database independent
Metabase API. This means
that it may also interface with
PEAR::MDB database abstraction layer
using its built-in Metabase API wrapper. In consequence, many types of
relational databases are already supported.
Since this is the first release of Metastorage, there is plenty of room for
improvement in the possibilities of the generated persistence APIs and the
level of optimization of the generated code. In the future it will be
supported other languages besides PHP, other database APIs besides
Metabase and other persistence containers besides relational
Metastorage is based on MetaL compiler
persistence module. Like
MetaL, Metastorage is Open Source and is distributed with
Downloadable archives and
documentation with an
example of component
definition are available from the