The EiffelStore library lets the user associate database elements with Eiffel objects. These database elements are basically database table rows, database view rows or more generally sets of database attribute values. The easiest way to manipulate database elements is to insert their content into Eiffel objects and to work on these Eiffel objects as database elements.

A first solution to implement this is to use some adaptable structures that will fit to any database element. This is done in EiffelStore through the DB_TUPLE class, which contains mainly an ARRAY [STRING] containing element attribute names and an ARRAY [ANY] containing element attribute values. This solution has one major drawback: any static checking is impossible: the developer cannot be sure at compile time of the nature of a DB_TUPLE , i.e. what it represents, and cannot know if attributes number, names and types are correct. To overcome this problem, a second solution is to use data structures that statically fits to the expected database element, as introduced in the DataObject Coupling section.

The major problem of this technique is that structures are static: one structure, so one class instead of one object, should be created for each database element.

f443ed73-14bb-9a3a-b7c7-35c2660e7784
cached: 06/26/2017 9:26:44.000 PM