Академический Документы
Профессиональный Документы
Культура Документы
Database systems employing object-oriented models have been touted as the emerging form for the next generation of systems. Some say that just as the relational model has supplanted the network (C D!S"#$ and hierarchical models% so too will object-oriented models supplant the relational model.
&uestions' (. !re these predictions true) *. +hat are the reasons behind them) ,o begin% we must examine the strengths and weaknesses of the relational model.
*--.(*((' slides*-' ( of (/
,he data model and access to it is simple to understand and use% even for those who are not experienced programmers.
,he model of data represented in tables is remarkably simple. !ccess to data via the model does not re0uire navigation (roughly% following pointers$% as do the C D!S"# and network models. 1t admits a simple (in principle$% declarative 0uery language.
,here are straightforward database design procedures. ,he data model admits a solid and wellunderstood mathematical foundation (first-order predicate logic$. ,his has facilitated the development of a sophisticated theoretical underpinning% which has contributed greatly to the features of practical systems. 2fficient implementation techni0ues are well known and widely used. Standards exist both for 0uery languages (S&#$ and for interfaces via programming languages (embedded S&# and D3C4C#1$.
*--.(*((' slides*-' * of (/
With all of these strengths, why go beyond the relational model in general, and to an objectoriented model in particular? (. ,here are some forms of data and knowledge which the relational model cannot accommodate easily and ade0uately. *. bject-oriented programming languages are emerging as the dominant form within development environments for large-scale software systems. ! relational database model is not a good match to an object-oriented host language. 5. #anguage-independent system environments which are based upon object-oriented models are emerging% and promise to be extremely important in the future. Dominant example' 67 ( bject 6anagement 7roup$ standards. ,o begin% the first point is examined in more detail.
*--.(*((' slides*-' 5 of (/
*--.(*((' slides*-' = of (/
1n the relational model% entities have no independent identification or existence. bjects can only be identified and accessed indirectly via the identification of those attributes which characteri>e them.
2xample'
1n the Company database of the textbook% it is difficult to speak of an employee as a fundamental entity. !n employee only exists by virtue of a list of attributes in some tables.
*--.(*((' slides*-' . of (/
#! $%plicit relationships: 1n entity-relationship modelling% explicit entities and relationships were specified. 1n the relational model% the identities of relationships have no explicit representation. :elationships must be recovered by executing 0uery operations on the database. ,hese relationships must be known to the user from information not contained in the relational representation. ,here is a hidden semantics in the relational model. 2xample from the Company database of the text'
1n the relational reali>ation of the information embodied diagram shown below% the Supervision relation% as well as the Supervisor and Supervisee r?les% are hidden.
Supervisor 2mployee Supervision Supervisee
*--.(*((' slides*-' @ of (/
1n the following example% the relationship becomes a relation connecting two other relations.
2mployee
+orksB n
<roject
Cours
*--.(*((' slides*-' A of (/
&! 'tructured data objects: 8irst normal form ((D8$ stipulates that the values for attributes in a tuple be atomic. ,his prohibits the kind of complex values illustrated below% in which the values of domains are themselves tuples.
Name SSN BDate Fname Minit Address Sex Salary SuperSSN Zip DNO
LName
Street City
State
Dote that this is a natural form of modelling in this application. 1t also prohibits so-called collection types% such as sets% lists% and multisets. ,his is illustrated in the example below% in which a separate relation capturing department locations must be used.
Department
Dname Dnumber MGRSSN MGR-Startdate DLocations
. = (
*--.(*((' slides*-' / of (/
(! )enerali*ation and inheritance: ,he classes of entities to be modelled in a database often have a natural hierarchical structure. !n example from a university situation is shown below. <erson
2mployee
Speciali>ation
Student ,eacher
7enerali>ation
,he class of objects associated with a type higher in the hierarchy is a superset of that associated with that of a class lower in the hierarchy 2very 2mployee is a ,eacher. 2very Student 1nstructor is both a Student and an 1nstructor. 8or this reason% these are sometimes called ISA hierarchies.
*--.(*((' slides*-' ; of (/
Classes which lie lower in the hierarchy inherit attributes from those higher up.
!ssume that every person has an SSD. ,hen every Student% 2mployee% ,eacher% and and Student 1nstructor has an SSD also. !ssume that every 2mployee has an employee number. ,hen every ,eacher and every Student 1nstructor has an employee number also% but this is not necessarily the case for <ersons or Students.
+hen an object class inherits attributes from two or more object classes (e.g., Student 1nstructor from both Student and 1nstructor$% it is called multiple inheritance.
*--.(*((' slides*-' (- of (/
1n the relational model% for read-only 0ueries% this may be accomplished via views (although they introduce overhead% due to the need of the system to maintain the current value$. 8or updates% there is no similar mechanism available in the relational model. Such procedures must be maintained outside of the relational model itself.
*--.(*((' slides*-' (( of (/
*--.(*((' slides*-' (* of (/
Hendors which have followed this line with proprietary commercial products'
!lthough some features may be similar% they are not compatible beyond the S&#'(;;; level.
*--.(*((' slides*-' (5 of (/
1n addition% there have been attempts to extend S&# to accommodate desired features.
S&#'(;;; (also called S% S&#-;;$' ! standard which has recently been completed% and which addresses some of these concerns. S&#'*--5 (also called S&#=% S&#'*--n$' ! standard currently under development% which will address other issues.
,hese standards attempt to be compatible with the earlier version of S&# (S&#*% S&#-;*$% with only small changes.
*--.(*((' slides*-' (= of (/
2ach system displayed strength for certain types of applications. ,he systems are not compatible with one another.
!fter this initial phase of system development% the various vendors began to develop a standard for the next generation of systems.
*--.(*((' slides*-' (. of (/
*--.(*((' slides*-' (@ of (/
,he extensions do add some needed features. Cowever... ,he definitions seem to be ad hoc% and not based upon sound object-oriented theory.
".M) proposal:
,he foundations are much more solid% relative to the foundations of object-oriented systems. Cowever... 6any of the advantages of the relational model are lost.
ne needs a fair amount of expertise to use such systems. Schema design is a much more involved process. 1n many cases% the systems are oriented towards a particular host language.
"M) Framewor0:
,he ideas embodied in this proposal are already becoming a standard. ,he details are outside of the scope of this course.
*--.(*((' slides*-' (A of (/
1t depends upon the application at hand. Do one of these is superior to the others in all possible situations.
! better understanding of these approaches can help one to decide which is most appropriate for a given application% however.
*--.(*((' slides*-' (/ of (/