14.06.2013 Views

Databases and Systems

Databases and Systems

Databases and Systems

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

115<br />

In fig. 2, the Objects <strong>and</strong> Classes tables have been repeated from fig. 1. The<br />

Classes table has an extra field, EAV_Flag, a Boolean that records whether the<br />

implementation of this class is EAV (if true) or conventional (if false). EAV makes<br />

sense only for heterogeneous data, <strong>and</strong> there is no reason why a homogenous class<br />

with a large number of object instances should not be implemented conventionally.<br />

For each class, a description of the applicable attributes is stored in the<br />

Class_Attributes table. Each Attribute has a name, a caption (for display to endusers<br />

as a label in a form) a data type, a serial number (that determines order of<br />

presentation) <strong>and</strong> a description (documentation). For BLOB datatypes, the "Type<br />

Details" field records the kind of data (e.g., mime-type) that an attribute represents,<br />

to assist management by application software. The Class Attributes table not only<br />

documents the class definition, but is actively consulted by the system for<br />

construction of input screens <strong>and</strong> generation of formatted output..<br />

The actual data for an object instance is stored in the EAV tables. (Only one of<br />

these, a table for integers, is shown in the figure.) The table Class_Hierarchy<br />

records the parent-child relationships between Class definitions (not class instances:<br />

these are stored in an Object_Hierarchy table as described earlier). This table is<br />

consulted when the user specifies a query based on a super-class that might<br />

encompass sub-classes as well.<br />

Limitations of the EAV model<br />

The simplicity of EAV comes with a price, namely, a performance penalty. The<br />

physical representation of a class is quite different from its logical view as seen by<br />

the user. Assembling all the "columns" associated with a particular class object<br />

involves consulting the Class Attributes table <strong>and</strong> then gathering data from the<br />

appropriate EAV tables. More important, complex Boolean query of classes requires

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!