Subscribe by Email


Sunday, September 13, 2009

Object Definition language (ODL)

Object Definition Language (ODL) is the specification language defining the interface to object types conforming to the ODMG Object Model. Often abbreviated by the acronym ODL.
This language's purpose is to define the structure of an Entity-relationship diagram.

- Class Declarations
* interface < name > {elements = attributes, relationships,methods }
- Element Declarations
* attribute < type > < name >;
* relationship < rangetype >< name >;
- Method Example
* float gpa(in: Student) raises(noGrades)
# float = return type.
# in: indicates Student argument is read-only.
Other options: out, inout.
# noGrades is an exception that can be raised by method gpa.

ODL Type System :
- Basic types: int, real/ float, string, enumerated types, and classes.
- Type constructors: Struct for structures and four collection types: Set, Bag, List, and
Array.

ER versus ODL :
- E/R: arrow pointing to "one".
- ODL: don't use a collection type for relationship in the “many" class.
* Collection type remains in “one.”
- E/R: arrows in both directions.
- ODL: omit collection types in both directions.
- ODL only supports binary relationship.
- Convert multi-way relationships to binary and then represent in ODL.
- Create a new connecting entity set to represent the rows in the relationship set.
- Problems handling cardinality constraints properly!!

Keys in ODL :
- Indicate with key(s) following the class name, and a list of attributes forming the key.
* Several lists may be used to indicate several alternative keys.
* Parentheses group members of a key, and also group key to the declared keys.
* Thus, (key(a1; a2; : : : ; an )) = “one key consisting of all n attributes." (key a1; a2; : : : ; an ) =“each ai is a key by itself.
- Keys are not necessary for ODL. Object identity and not keys differentiates objects


No comments:

Facebook activity