ing/retrieving aggregated objects is performed to-
gether with the aggregating object. This strategy
is more flexible and scalable, since it allows an
easy way to support new aggregated objects. As
drawback, aggregated objects are not automati-
cally deleted on deletion of the aggregating ob-
jects, the mapping must to deal with this task.
Inheritance can be mapped using three different
strategies:
1. Single Table Inheritance: as happened in the sin-
gle table aggregation case, it is the optimal so-
lution in terms of performance, but it introduces
data redundance, poor scalability, contradicts the
normalization theory and can introduce data in-
consistency when performing schema evolutions.
2. Inheritance Tree: it minimizes or eliminates data
redundance. This schema provides a high scala-
bility degree. The main drawback is the number of
database operations needed to insert, delete or up-
date objects. So, performances decrease notably.
3. Path Table: it makes easy to perform path navi-
gation across the objects against data redundancy
and performances. Parent attributesare duplicated
in each inheritance class.
An important factor is the inheritance hierarchy
depth. Some solutions that work acceptable with flat
inheritance hierarchies become inefficient and com-
plicated with very deep inheritance hierarchies. Poly-
morphic read operations support and space storing re-
duction obtained when using multiple tables inheri-
tance introduce low or very low write/update perfor-
mances. Mapping solutions that clutter a single ob-
ject’s data across several tables might be fast for poly-
morphic reading, although they are very hard to main-
tain in case new object attributes are added or existing
object attributes are deleted.
Schema evolution becomes a nightmare when
multiple inheritance is allowed. When considering
unique inheritance, the use of a unique table in a
schema evolution implies the modification of the
number and/or types of the fields of a table. This fact
force to realize a big effort to ensure the consistency
of the table. The system must ensure that previous
and new data is consistently stored. When using
multiple tables, scalability is easier to implement
although the hierarchy depth can become a problem.
Path navigation is complex and expensive in terms
of database operations. The use of a inheritance
tree strategy minimizes the data redundancy existent
in the single table inheritance and in the path table
strategies, but is very difficult to perform path nav-
igation across object attributes since a great number
of complex queries must be performed. Note that
multiple inheritance is not considered.
Association can be mapped using different strategies:
1. Foreign Key Association: using two tables for a
1:N association, where the N is mandatory.
2. Association Table: using a new table to map N:M
associations.
Association presents the same drawbacks and ad-
vantages previously described for the aggregation
scenario, but involving two o three tables respectively.
4 MapO2R INTERNALS
MapO2R is a JAVA application that interacts with
some RDBMSs located in different sites. Both com-
puters (client and server) are interconnected by a
switched Gigabit Ethernet LAN. MapO2R supports
the following RDBMSs: MS Access 2007, Oracle 9i,
SQL Server 2008, MySQL 5.1 and PostgreSQL 8.4.1.
Due to its modularity and scalability, MapO2R can
support other RDBMSs by adding the corresponding
plugin. MapO2R follows a client-server architecture.
MapO2R acts on two stages: the generation and
the benchmarking (queries) stages. In the genera-
tion stage, the student selects an RDBMS and the
number of registers to consider (in the domain [500,
2,000,000] registers). Those registers are generated
automatically in order to obtain the benchmarking of
all the mappings described in Section 2. The bench-
marking stage provides the results obtained including
the average, the harmonic average, the median and
the standard deviation. Furthermore, the scale can be
either linear either logarithmic. Results can be pro-
vide in terms of figures or tables. The time is al-
ways measured in milliseconds. In order to obtain
reliable benchmarking results, each query (INSERT,
SELECT, DELETE and UPDATE) is performed fol-
lowing the number of iterations selected by the stu-
dent (ten iterations by default).
MapO2R does not maintain a JDBC connection
pool. Database session is closed and reopened for
each iteration. If a student selects an UPDATE query
over a set of 1,000 registers, with 25 iterations, the
session between the the application and the RDBMS
server is closed an reopened 25 times. The results ob-
tained from each set of queries are stored in a filesys-
tem in order to allow the comparison among the per-
formances provided for both different mapping strate-
gies and RDBMSs. MapO2R allows the visualization
of the results and also allows exporting the benchmark
results to CSV, plain text or MS Excel formats.
MapO2R: MAPPING OBJECT ORIENTED APPLICATIONS TO RELATIONAL DATABASES - A Case of Study
337