Database Access
All data and metadata in OME is expressed in tabular form and stored in a relational database. Since the OME design relies heavily on extensible semantic types, almost all of the underlying database is defined via XML-based semantic type descriptors. However, a few core tables cannot be defined as semantic types, and instead are defined explicitly by the Perl API.
All access to this database is controlled by the
object/relational mapping defined by
the OME::Factory
and OME::DBObject
classes. This mapping allows most database operations to be
performed without writing any SQL by hand. Creating a new
database table, for instance, is as simple as defining a new
Perl subclass of OME::DBObject
.
This arrangement, in which all database operations are defined by Perl method calls instead of hand-written SQL, allows the database access portion of the code to be more portable. Hooks are provided in several places for database-vendor-specific classes (database delegates) to override the default SQL-generation routines. This makes porting the OME backend to new database vendors much easier, since all of the SQL-specific code is contained in a single class.