1 Object Definition LanguageCORBA ODMG ODL (design OQL (queries Relational design ODL OODMBS input
2 ODL Declaraciones de Clase Declaracion de Elementos Ejemplointerface < name > {elements = attributes, relationships, methods } Declaracion de Elementos attribute < type > < name > ; relationship < rangetype > < name > ; Ejemplo float gpa(in: Student) raises(noGrades) float = return type. in: indica que el argumento Student es sólo lectura. Other options: out, inout. noGrades excepción determinada por gpa.
3 Ejemplo 1 Claves: ss#, loanid, branchidname amount loandid address type borrower customer loans Belongs-to Customer-of branch branchid location Claves: ss#, loanid, branchid Cardinalidad: cada prestamo perteneces a una cuenta.
4 Ejemplo (II) interface Customer { attribute string name; attribute integer ss#; attribute Struct Addr {string street, string city, int zip} address; relationship Set
5 Ejemplo (III) interface loans { attribute real amount;attribute int loanid; attribute Enum loanType {house, car, general} type; relationship Branch belongs-to inverse Branch::loans-granted; relationship Set
6 Ejemplo (IV) interface Branch { attribute integer branchid; attribute Struct Customer::Addr location; relationship Set
7 ODL Tipos de Datos Tipos básicos: int, real/ float, string, tipos enumerados, y clases. Tipos constructor: Estructura para estructuras tipo de coleccion: Set, Bag, List, y Array.
8 Limitaciones de AnidamientoRelación class colección Attributo Basico, sin clase structura colección
9 ER versus ODL E/R: flecha apunta a “one”.ODL: no usa una colección de tipos en la clase “many“. E/R: flecha en ambas direcciones. ODL: omite tipos de colecciones en ambas direcciones ODL solo soporta relaciones binarias. Convierte relaciones multi-way a binary.
10 Roles en ODL manager workerinterface employee { attribute string name; relationship Set
11 Subclases in ODL Subclass = special case = fewer entities/objects = más propiedades. Ejemplo: Facultad y Personal(Staff) don subclases de empleado. Facultad tiene año academico (9 salarios mes) pero staff tiene (12 salarios mes).
12 ODL Subclases interface Faculty:Employee { attribute real academic-year-salary; } Adquiere todos los atributos y métodos de la clase.
13 Claves ODL Identificados con keys(s) siguiendo el nombre de la clase y los atributos de la clave (key(a1; a2; : : : ; an )) = “one key consisting of all n attributes." (key a1; a2; : : : ; an ) =“each ai is a key by itself.