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.

Fig. 1.<br />

The ecommerce object model.<br />

of defining metrics for OR mapping impacts on non-functional<br />

characteristics. It has been shown that efficiency, maintainability,<br />

and usability, among the set of all quality attributes<br />

defined by the ISO/IEC 9126-1 standard, are characteristics<br />

significantly influenced by OR mappings [8]. For each of those<br />

attributes, we use a set of metrics suggested by Holder et<br />

al. [8] and Baroni et al. [2]. The metrics are Table Access for<br />

Type Identification (TATI), Number of Corresponding Table<br />

(NCT), Number of Corresponding Relational Fields (NCRF),<br />

Additional Null Value (ANV), Number of Involved Classes<br />

(NIC) and Referential Integrity Metric (RIM).<br />

To measure these metrics, we developed a set of queries to<br />

execute over synthesized alternatives. For brevity, and because<br />

it suffices to make our point, we concisely describe one of<br />

these metrics and the corresponding query in the following.<br />

Spacemaker supports the others as well.<br />

The Number of Corresponding Relational Fields (NCRF)<br />

metric specifies the extent of change propagation for a given<br />

OR mapping. Specifically, the NCRF metric manifests the<br />

effort required to adapt a relational schema after applying a<br />

change, such as inserting or deleting an attribute, over a class.<br />

According to the definition, given a class C, NCRF(C) specifies<br />

the number of relational fields in all tables that correspond to<br />

each non-inherited, non-key attribute of C. The specification<br />

of a query we designated to measure the NCRF metric over<br />

synthesized alternatives is given below:<br />

NCRF(C) = #(C.attrSet - C.id). fAssociate. fields<br />

The Alloy dot operator denotes a relational join. While<br />

attrSet specifies a set of non-inherited attributes of a class,<br />

fAssociate is a relation from a table field to its associated class<br />

attribute. The query expressions then, by using the Alloy set<br />

cardinality operator (#), defines the NCRF metric.<br />

Exploring, Evaluating and Choosing<br />

The next step is to explore and prune the space of mapping<br />

alternatives according to quality measures. Spacemaker partitions<br />

the space of satisfactory mixed mapping specifications<br />

into equivalence classes and selects at most a single candidate<br />

from each equivalence class for presenting to the end-user.<br />

To partition the space, Spacemaker evaluates each alternative<br />

with respect to previously described relevant metrics. So<br />

each equivalence class consists of all alternatives that exhibit<br />

the same characteristics. Specifically, two alternatives a 1 and<br />

a 2 are equivalent if value(a 1 , m i ) = value(a 2 , m i ) for all<br />

metrics (m i ). Because equivalent alternatives all satisfy the<br />

mapping constraints, it suffices to select one alternative in<br />

each equivalence class to find a choice alternative. Given<br />

that quality characteristics are usually conflicting, there is<br />

generally no single optimum solution but there are several<br />

pareto-optimal choices representing best trade-offs.<br />

C. Model Splitting<br />

As with many formal techniques, the complexity of constraint<br />

satisfaction restricts the size of models that can actually<br />

be analyzed [7]. Our approach also requires an explicit<br />

representation of the set of all quality equivalence classes of<br />

mapping alternatives, which in general grows exponentially in<br />

the number of elements in a model.<br />

To address these scalability problems, we split the object<br />

model into sub-models. The key idea is that since for association<br />

relationships with cardinality of many-to-many, there<br />

is just one applicable mapping strategy, i.e. own association<br />

table, we make use of such relations to split the object model<br />

into sub-models.<br />

We consider an object model as a graph, G objModel =<<br />

V,E >, where nodes V represent classes, and there is an<br />

edge < v i ,v j > joining two nodes v i and v j if there is<br />

a direct relationship including association and generalization<br />

link between them. We assume that G objModel is connected.<br />

Otherwise, we consider each sub-graph separately. An edge<br />

joining two nodes v i and v j in a graph is a bridge if removing<br />

the edge would cause v i and v j to lie in two separate subgraphs<br />

[5]. A bridge is the only route between its endpoints. In<br />

other words, bridges provide nodes with access to parts of the<br />

graph that are inaccessible by other means. So, to decompose<br />

a graph G objModel , we remove all bridges of type many-tomany<br />

association.<br />

To make our idea concrete we consider the ecommerce<br />

domain model we adopted from Lau and Czarnecki [13].<br />

According to the diagram shown in Figure 1, there are two<br />

such bridges: < P roduct, Asset > and < Item, P roduct >.<br />

By removing those bridges we obtain three smaller sub-graphs.<br />

The gain then comes from the reduction in the sizes of<br />

the constraint solving problems. That is, we replace a large<br />

690

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

Saved successfully!

Ooh no, something went wrong!