2/15/11%1%Class%Hierarchies%• En22es%in%a%set%may%have%a%natural%“inheritance”%rela2onship%– i.e.%Two%en2ty%sets%E1,%E2;%x%∈%E1%%x%∈%E2%• “IsA”%inheritance%– En2ty%x%should%have%all%aEributes%that%en22es%in%E2%have,%and%perhaps%more%• The%DBMS%must%know%to%look%at%en2ty%set%E1%when%asked%a%ques2on%about%E2%Copyright%©%Ben%CartereEe% 23%Class%Hierarchies%• Hierarchies%model%generaliza)on%and%specifica)on%– Specifica2on:%%the%highestRlevel%class%specializes%into%mul2ple%lowerRlevel%classes%with%dis2nct%characteris2cs%– Generaliza2on:%%lowerRlevel%classes%have%common%characteris2cs%that%can%define%a%higherRlevel%class%• Hierarchical%constraints:%– Overlap1constraints:%%Can%two%subclasses%contain%the%same%en2ty?%%If%so,%they%overlap%– Completeness1constraints:%%Does%every%en2ty%have%a%subclass?%%If%so,%hierarchical%rela2onship%is%total1Copyright%©%Ben%CartereEe% 24%2/15/11%2%Aggrega2on%• We%may%want%to%model%a%rela2onship%between%en22es%and%another%rela2onship%• Aggrega)on%indicates%that%a%rela2onship%set%par2cipates%in%another%rela2onship%set%– Why%a%separate%feature?%%Because%rela2onships%are%defined%in%terms%of%en22es%only%• An%example%of%a%higherRlevel%decision%influencing%lowerRlevel%decisions%– Why%not%redefine%rela2onships%to%include%other%rela2onships?%%Then%rela2onships%need%keys%Copyright%©%Ben%CartereEe% 25%Summary%• The%first%step%in%designing%a%database%and%database%applica2on%is%requirements1analysis1• Requirements%analysis%leads%to%a%model%of%the%data%• The%en)ty:rela)onship1model%is%a%simple%but%flexible%way%to%model%data%in%terms%of%en))es1and%rela)onships1– ER%diagrams%allow%easy%visualiza2on%of%the%model%Copyright%©%Ben%CartereEe%
View Full Document