MCS-043 IGNOU STUDY MATERIAL

Page 179

Enhanced Database Models

inverse Book::receivedby; void findcity(in set<string>,out set<string>) raises(notfoundcity); }; In the method find city, the name of city is passed referenced, in order to find the name of the student who belongs to that specific city. In case blank is passed as parameter for city name then, the exception notfoundcity is raised. The ODL could be atomic type or class names. The basic type uses many class constructors such as set, bag, list, array, dictionary and structure. We have shown the use of some in the example above. You may wish to refer to the further readings section. Inheritance is implemented in ODL using subclasses with the keyword “extends”. class Journal extends { attribute string attribute string attribute string };

Book VOLUME; emailauthor1; emailauthor2;

Multiple inheritance is implemented by using extends separated by a colon (:). If there is a class Fee containing fees details then multiple inheritance could be shown as: class StudentFeeDetail extends Student:Fee { void deposit(in set <float>, out set <float>) raises(refundToBeDone) }; Like the difference between relation schema and relation instance, ODL uses the class and its extent (set of existing objects). The objects are declared with the keyword “extent”. class Student (extent firstStudent) { attribute string ENROLMENT_NO; attribute string NAME; .......... }; It is not necessary in case of ODL to define keys for a class. But if one or more attributes have to be declared, then it may be done with the declaration on key for a class with the keyword “key”. class student (extent firstStudent key ENROLMENT_NO) { attribute string ENROLMENT_NO; attribute string NAME; .......... }; Assuming that the ENROLMENT_NO and ACCESSION_NO forms a key for the issue table then: class Issue (extent ACCESSION_NO)) 18

thisMonthIssue

key

(ENROLMENT_NO,


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.