Databases Reference
In-Depth Information
Class Essay (extent essays)
{ attribute string (20) name;
attribute set
SCourse
TCredits
DDelivery
<
string(10)
>
kwords;
attribute short credits;
void essay ();
void drop (); };
1..*
Essay
Name
KWords
Credits
Class SCourse (extent scourses)
{ attribute short tcredits;
attribute date ddelivery;
attribute set
<
Essay
>
offered_essays;
};
Figure 7.10
Member-collection aggregation in the ODMG data model.
The part-whole aggregation could also be represented in ODL defining
each component class as an attribute in the composite class, just like dif-
ferent member-collection aggregations, missing the part-whole aggregation
abstraction.
We can see that member-collection aggregation is supported as a collec-
tion attribute, in the same way as multivalued attributes are supported, and
there are no differences between member-collection and part-whole aggre-
gation. We could also consider other design alternatives, such as defining
aggregation as a relationship. Object databases do not currently provide
special constructors for the aggregation concept either. However, some theo-
retical proposals do extend the ODMG data model to support composite
objects [24].
7.6.2.5 Collection and Structured Types
As we have seen, collection and structured types are key concepts in the
object-oriented database design, and they also constitute one of the main dif-
ferences with regard to the relational databases. They allow the definition
of multivalued attributes, the cardinality of relationships, aggregations, and
so on. The ODMG data model supports different kinds of collection types;
now the question is how to choose the most appropriate type. As a rule, we
should use the following:
A bag type, if the collection type allows duplicates and has an
unbounded number of elements, and the order is not relevant. For
example, the drum for a lottery has an unbounded number of balls.
ยท
 
Search WWH ::




Custom Search