27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Spacemaker: Practical Formal Synthesis of Tradeoff<br />

Spaces for Object-Relational Mapping<br />

Hamid Bagheri<br />

University of Virginia,<br />

151 Engineer’s Way,<br />

Charlottesville, VA 22903 USA<br />

hb2j@virginia.edu<br />

Kevin Sullivan<br />

University of Virginia,<br />

151 Engineer’s Way,<br />

Charlottesville, VA 22903 USA<br />

sullivan@virginia.edu<br />

Sang H. Son<br />

University of Virginia,<br />

151 Engineer’s Way,<br />

Charlottesville, VA 22903 USA<br />

son@virginia.edu<br />

Abstract—Developing mixed object-relational (OR) mappings<br />

that achieve desirable quality attribute tradeoffs for objectoriented<br />

applications is difficult, tedious, costly, and error-prone.<br />

We contribute a practical, automated technique for exhaustive,<br />

formal synthesis of large spaces of such mappings, and the<br />

clustering of individual mappings in these spaces into multidimensional<br />

quality equivalence classes. This technique can help<br />

engineers to design effective persistence layers for object-oriented<br />

applications. Our approach is to use a formal language to<br />

describe both a space of mappings and multiple quality attribute<br />

valuation functions on points in such a space. We use a constraint<br />

solver to exhaustively enumerate points in this space and their<br />

valuations. We then cluster the results into quality attribute<br />

equivalence classes. This work promises to reduce the cost and<br />

time required to develop mixed OR mappings, ensure their formal<br />

correctness, and help engineers to understand and make tradeoffs<br />

quantitatively. We conducted application-oriented experiments to<br />

test feasibility and scalability of our approach. In one experiment<br />

we synthesized an OR mapping tradeoff space for a real e-<br />

commerce application, synthesizing and classifying hundreds of<br />

thousands of mappings in just a few minutes.<br />

Index Terms—Design; Database; Object-relational mapping;<br />

Design space exploration; Alloy Language.<br />

I. INTRODUCTION<br />

Object-oriented applications often need to use relational<br />

databases for persistent storage. Transformations between<br />

instance models in these two paradigms encounter the socalled<br />

impedance mismatch problem [9]. Object-relational<br />

mapping (ORM) systems are now widely used to bridge the<br />

gap between object-oriented application models and relational<br />

database management systems (DBMS), based on applicationspecific<br />

definitions on how object models are to be mapped to<br />

database structures.<br />

The problem we address is that today one has to choose between<br />

automatic generation of mappings using pure mapping<br />

strategies [3], [9], or the manual design of mixed mappings,<br />

in which different mapping strategies are applied to individual<br />

classes rather than to entire inheritance hierarchies. Producing<br />

pure mappings automatically is easy, but it often leads to<br />

sub-optimal results. Developing mixed mappings by hand can<br />

achieve much higher quality, but it is hard and error-prone.<br />

Among other things, it requires a thorough understanding<br />

of both object and relational paradigms, of large spaces of<br />

possible mappings, and of the tradeoffs involved in making<br />

choices in these spaces.<br />

To address this problem, we present an approach that<br />

provides both the quality benefits of mixed mappings and<br />

the productivity benefits of automated synthesis. We present a<br />

practical formal automated technique, implemented in a prototype<br />

tool that we call Spacemaker, for exhaustive synthesis<br />

of mixed OR mappings and their classification into quality<br />

attribute equivalence classes. We take as inputs a formal object<br />

model and optional class-specific mapping strategies for those<br />

classes that the user wants mapped in a specific manner.<br />

We then use an automated constraint solver to exhaustively<br />

generate the space of mappings subject to the given constraints,<br />

along with multiple quality attribute measures for<br />

each mapping. Next we cluster mappings into quality attribute<br />

equivalence classes and present candidates from each class to<br />

the engineer along with the measures of its quality attributes.<br />

The engineer can then select a mapping to satisfy tradeoff<br />

preferences. Our prototype tool uses Alloy as a specification<br />

language [10], and the Alloy analyzer as a constraint solver.<br />

In more detail, we claim four main contributions: (1) We<br />

present what is to our knowledge the first formalization of<br />

fine-grained and mixed ORM strategies by means of mapping<br />

functions; (2) we contribute a fully automated approach for<br />

formally precise synthesis of mapping tradeoff spaces, based<br />

on this formalization; (3) we present an experimental demonstration<br />

of technical feasibility and scalability to practically<br />

meaningful applications; and (4) we develop the Spacemaker<br />

tool [1], which we make available to the research and education<br />

community. Data from our experiments support the<br />

claim that our technique can reduce the time to develop highquality<br />

OR mappings, ensure their correctness, and enable<br />

engineers to make tradeoffs based on automatically computed<br />

quality attributes for a full range of possible mappings rather<br />

than on intuition or hard-to-acquire expertise in OR mapping<br />

strategies.<br />

The rest of this paper is organized as follows. Section II<br />

presents our approach. Section III reports and discusses data<br />

from the experimental testing of our approach. Section IV<br />

surveys the related work. Section V concludes the paper with<br />

an outline of our future work.<br />

II. APPROACH<br />

We present our approach in three parts. We first formalize<br />

application of object-relational mapping strategies. We then<br />

688

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

Saved successfully!

Ooh no, something went wrong!