Está en la página 1de 83

1

Unit-4

Design axioms

Designing Classes

Access Layer

Object Storage

Object Interoperability
2
Object-Oriente Design !rocess
an Design Axioms

Analysis !"ase
#
Class$s attrib%tes& met"os an associations are
ienti'ie
#
!"ysical entities& players an t"eir cooperation are
ienti'ie
#
Objects can be ini(i%als& organi)ations or mac"ines

Design !"ase
#
Using Implementation lang%age appropriate ata
types are assigne
#
*le(ate t"e moel into logical entities +%ser inter'aces,
#
-oc%s is on t"e (ie. an access classes +/o. to
maintain in'ormation or best .ay to interact .it" a
%ser,
0
Importance o' 1oo Design

2ime spent on esign ecies t"e s%ccess o' t"e


so't.are e(elope3

1oo esign simpli'ies implementation an


maintenance o' a project3

2o 'ormali)e esign process& axiomatic


approac" is to be 'ollo.e

Acti(ities o' OOD !rocess


#
Apply esign axioms to esign classes& t"eir
attrib%tes& met"os& associations& str%ct%re an
protocols
4
Object Oriente Design !rocess

Design access layer

Create mirror classes4 -or e(ery b%siness class


ienti'ie an create& create one access class3
*g & i' t"ere are 0 b%siness classes +class1&
class2 an class0,& create 0 access layer
classes +class1D5& class2D5 an class0D5,

Ienti'y access layer class relations"ips

Simpli'y classes an t"eir relations"ips # to


eliminate re%nant classes an str%ct%res
# 6e%nant classes4 Do not 7eep 2 classes t"at
per'orm similar translate re8%est an translate res%lts
acti(ities3 Select one an eliminate t"e ot"er3
# 9et"o classes4 6e(isit t"e classes t"at consist o' only
one or t.o met"os to see i' t"ey can be eliminate or
combine .it" existing classes3
:
Object Oriente Design !rocess

Design t"e (ie. layer classes


# Design t"e macro le(el %ser inter'ace& ienti'ying (ie. layer
objects
# Design t"e micro le(el %ser inter'ace
# 2est %sability an %ser satis'action

Iterate an re'ine t"e ."ole esign3

-rom t"e U9L class iagram& begin to extrapolate


."ic" classes one "as to b%il an ."ic" existing
classes one "as to re%se3

Also t"in7 abo%t t"e in"eritance str%ct%re3

I' .e "a(e se(eral classes t"at seem relate b%t "a(e


speci'ic i''erences& one probably "as to ma7e t"em
common s%bclasses o' an existing class or one t"at
.e e'ine3

All esigne components m%st trace bac7 to t"e %ser


re8%irements3
;
Object-Oriente Design Axioms

An axiom is a '%namental tr%t" t"at al.ays is


obser(e to be (ali an 'or ."ic" t"ere is no
co%nterexample or exception3

2"ey can not be pro(en or eri(e b%t t"ey can


be in(aliate by co%nterexamples or
exceptions3

A t"eorem is a proposition t"at may not be sel'-


e(ient b%t can be pro(e 'rom accepte
axioms3

A corollary is a proposition t"at 'ollo.s 'rom an


axiom or anot"er proposition t"at "as been
pro(en3
<
Axioms o' OOD

2"e axiom 1 o' object-oriente esign eals .it"


relations"ips bet.een system components +s%c" as
classes& re8%irements an so't.are components, an
axiom 2 eals .it" t"e complexity o' esign3

Axiom 13 2"e inepenence axiom3 9aintain t"e


inepenence o' components3 Accoring to axiom 1&
eac" component m%st satis'y its re8%irements .it"o%t
a''ecting ot"er re8%irements3 *g3 Let %s esign a
re'rigerator oor ."ic" can pro(ie access to 'oo an
t"e energy lost s"o%l be minimi)e ."en t"e oor is
opene an close3 Opening t"e oor s"o%l be
inepenent o' losing energy3

Axiom 23 2"e in'ormation axiom3 9inimi)e t"e


in'ormation content o' t"e esign3 It is concerne .it"
simplicity3 In object-oriente system& to minimi)e
complexity %se in"eritance an t"e system$s b%ilt in
classes an a as little as possible to ."at alreay is
t"ere3
=
Corollaries

Corollary 14 Unco%ple esign .it" less


in'ormation content3 /ig"ly co"esi(e objects
can impro(e co%pling beca%se only a minimal
amo%nt o' essential in'ormation nee be passe
bet.een objects3

Corollary 24 Single p%rpose3 *ac" class m%st


"a(e a single& clearly e'ine p%rpose3 >"ile
oc%menting& one s"o%l be able to escribe t"e
p%rpose o' a class in 'e. sentences3

Corollary 04 Large n%mber o' simple classes3


?eeping t"e classes simple allo.s re%sability3
@
Corollaries

Corollary 44 Strong mapping3 2"ere m%st be a


strong association bet.een t"e p"ysical system
+analysis$s objects, an logical esign +esign$s
object,3

Corollary :4 Stanari)ation3 !romote


stanari)ation by esigning inter c"angeable
components an re%sing existing classes or
components3

Corollary ;4 Design .it" in"eritance3 Common


be"a(ior +met"os, m%st be mo(e to s%per
classes3 2"e s%perclass-s%bclass str%ct%re
m%st ma7e logical sense3
1A
Corollary 14 Unco%ple Design
.it" Less In'ormation Content

Co%pling is a meas%re o' t"e strengt" o'


association establis"e by a connection 'rom
one object or so't.are component to anot"er3
Co%pling is a binary relations"ip3 It is important
'or esign beca%se a c"ange in one component
s"o%l "a(e a minimal impact on t"e ot"er
components3

2"e egree or strengt" o' co%pling bet.een 2


components is meas%re by t"e amo%nt an
complexity o' in'ormation transmitte bet.een
t"em3 Object oriente esign "as 2 types o'
co%pling4 interaction co%pling an in"eritance
co%pling3
11
Interaction co%pling

Interaction co%pling in(ol(es t"e amo%nt


an complexity o' messages bet.een
components3 It is goo to "a(e little
interaction3 2"e general g%ieline is to
7eep t"e message as simple an
in're8%ent as possible3 Objects connecte
to many complex messages are tig"tly
co%ple& meaning any c"ange to one
in(ariably leas to a ripple e''ect o'
c"anges in ot"ers3
12
In"eritance - co%pling

In"eritance is a 'orm o' co%pling bet.een s%per


an s%b classes3 A s%bclass is co%ple to its
s%perclass in terms o' attrib%tes an met"os3
>e nee "ig" in"eritance co%pling3 -or t"is
eac" speciali)ation class s"o%l not in"erit lot o'
%nrelate an %nneee met"os an attrib%tes3
I' t"e s%perclass is o(er.riting most o' t"e
met"os or not %sing t"em& t"en it is an
inication t"at t"e in"eritance co%pling is lo.3
10
Co"esion

Co"esion4 2"e interactions .it"in a single object or


so't.are component is calle co"esion3

Co"esion re'lects t"e Bsingle-p%rposenessC o' an


object3

/ig"ly co"esi(e components can lo.er co%pling


beca%se only a minim%m o' essential in'ormation
nee be passe bet.een components3

9et"o co"esion& means t"at a met"o s"o%l


carry one '%nction3

A met"o t"at carries m%ltiple '%nctions is


%nesirable3

Class co"esion means t"at all t"e class$s met"os


an attrib%tes m%st be "ig"ly co"esi(e& meaning to
be %se by internal met"os or eri(e classes$
met"os3
14
Corollary 24 Single !%rpose

*(ery class s"o%l be clearly e'ine an


necessary in t"e context o' ac"ie(ing t"e
system$s goals3

>"en .e oc%ment a class& .e s"o%l be able


to explain its p%rpose in a sentence or t.o3

I' .e cannot& t"en t"e class s"o%l be


s%bi(ie into inepenent pieces3

*ac" met"o m%st pro(ie only one ser(ice3

*ac" met"o s"o%l be o' moerate si)e& no


more t"an a pageD "al' a page is better3
1:
Corollary 04 Large n%mber o'
simpler classes& 6e%sability

2"ere are bene'its in "a(ing a large


n%mber o' simpler classes beca%se t"e
c"ances o' re%sing smaller classes in
ot"er projects is "ig"3

Large an complex classes are too


speciali)e to be re%se3

Object-oriente esign o''ers a pat" 'or


pro%cing libraries o' re%sable parts3
1;
>"y re%sability is not %seE
So't.are engineering textboo7s teac" ne. practitioners
to b%il systems 'rom B'irst principlesCD re%sability is not
promote or e(en isc%sse

2"e Bnot in(ente "ereC synrome an t"e intellect%al


c"allenge o' sol(ing an interesting so't.are problem in
one$s o.n %ni8%e .ay mitigates against re%sing
someone else$s so't.are component3

Uns%ccess'%l experiences .it" so't.are re%sability in t"e


past "a(e con(ince many practitioners an
e(elopment managers t"at t"e concept is not practical3

9ost organi)ations pro(ie no re.ar 'or re%sabilityD


sometimes pro%cti(ity is meas%re in terms o' ne.
lines o' coe .ritten pl%s a isco%nte creit
1<
Corollary 44 Strong mapping

A strong mapping lin7s classes ienti'ie


%ring analysis an classes esigne
%ring t"e esign p"ase eg (ie. an
access classes3

2"e analyst ienti'ies objects$ types an


in"eritance& an t"in7s abo%t e(ents t"at
c"ange t"e state o' objects3

2"e esigner as etail to t"is moel


per"aps esigning screens& %ser
interaction& an client-ser(er interaction3
1=
Corollary :4 Stanari)ation

2o re%se classes& .e m%st "a(e a goo


%nerstaning o' t"e classes3

9ost object-oriente systems come .it"


se(eral b%ilt-in class libraries3

5%t t"ese class libraries are not al.ays


.ell oc%mente3

Sometimes t"ey are oc%mente& b%t not


%pate3

2"ey m%st be easily searc"e& base on


%sers$ criteria3
1@
Corollary ;4 Designing .it"
in"eritance

>"en .e implement a class& .e "a(e to


etermine its ancestor& ."at attrib%tes it .ill
"a(e& an ."at messages it .ill %nerstan3

2"en .e "a(e to constr%ct its met"os an


protocols3

Ieally& one "as to c"oose in"eritance to


minimi)e t"e amo%nt o' program instr%ctions3

2"e primiti(e 'orm o' re%se is c%t-an-paste


re%sability3
2A
Ac"ie(ing 9%ltiple In"eritance in a
Singe In"eritance System

Single in"eritance means t"at eac" class "as only a


single s%per class3

2"e res%lt o' %sing a single in"eritance "ierarc"y is t"e


absence o' ambig%ity as to "o. an object .ill respon in
a gi(en met"oD

>e simply trace %p t"e class tree beginning .it" t"e


object$s class& loo7ing 'or a met"o o' t"e same name3

5%t lang%ages li7e LIS! or CFF "a(e a m%ltiple


in"eritance sc"eme ."ereby objects can in"erit be"a(ior
'rom %nrelate areas o' t"e class tree3

2"e complication "ere is "o. to etermine ."ic"


be"a(ior to get 'rom ."ic" class& partic%larly ."en
se(eral ancestors e'ine t"e same met"o3

One .ay o' resol(ing t"is is to in"erit 'rom t"e most


appropriate class an a an object o' mot"er class as
an attrib%te or aggregation3 2"e ot"er is to %se t"e
instance o' t"e class +object, as an attrib%te3
21
Design !atterns

A esign pattern pro(ies a sc"eme 'or


re'ining t"e s%bsystem or components o' a
so't.are system or t"e relations"ips
among t"em3

2"ey allo. systems to s"are 7no.lege


abo%t t"eir esign& by escribing
commonly rec%rring str%ct%res o'
comm%nicating components t"at sol(e a
general esign problem .it"in a partic%lar
context
22
Designing Classes

Object-oriente esign re8%ires ta7ing t"e


object ienti'ie %ring object-oriente
analysis an esigning classes to
represent t"em3

As a class esigner& .e "a(e to 7no. t"e


speci'ics o' t"e class .e are esigning
an also .e s"o%l be a.are o' "o. t"at
class interacts .it" ot"er classes3
20
Object oriente esign p"ilosop"y

/ere one "as to t"in7 in terms o' classes3 As


ne. 'acts are ac8%ire& .e relate t"em to
existing str%ct%res in o%r en(ironment +moel,3

A'ter eno%g" ne. 'acts are ac8%ire abo%t a


certain area& .e create ne. str%ct%res to
accommoate t"e greater le(el o' etail in o%r
7no.lege3

2"e important acti(ity in esigning an application


is coming %p .it" a set o' classes t"at .or7
toget"er to pro(ie t"e '%nctionality .e esire3

I' .e esign "e classes .it" re%sability in min&


.e .ill gain a lot o' pro%cti(ity an re%ce t"e
time 'or e(eloping ne. applications3
24
Class (isibility4 Designing .ell-e'ine p%blic&
pri(ate an protecte protocols

In esigning met"os or attrib%tes 'or classes&


.e are con'ronte .it" t.o problems3

One is t"e protocol or inter'ace to t"e class


operations an its (isibility an t"e ot"er is "o.
it is implemente3

2"e class$s protocol or t"e messages t"at a


class %nerstans& can be "ien 'rom ot"er
objects +pri(ate protocol, or mae a(ailable to
ot"er objects +p%blic protocol,3

!%blic protocols e'ine t"e '%nctionality an


external messages o' an object3

!ri(ate protocols e'ine t"e implementation o'


an object3
2:
Gisibility

A class mig"t "a(e a set o' met"os t"at it %ses only


internally& messages to itsel'3 2"is pri(ate protocol o' t"e
class& incl%es messages t"at normally s"o%l not be
sent 'rom ot"er objects3 /ere only t"e class itsel' can
%se t"e met"os3

2"e p%blic protocol e'ines t"e state be"a(ior o' t"e


class as a citi)en in a pop%lation an is important
in'ormation 'or %sers as .ell as '%t%re escenants& so it
is accessible to all classes3 I' t"e met"os or attrib%tes
can be %se by t"e class itsel' +or its s%bclasses, a
protecte protocol can be %se3 /ere s%bclasses can
%se t"e met"o in aition to t"e class itsel'3

2"e lac7 o' .ell-esigne protocol can mani'est itsel' as


encaps%lation lea7age3 It "appens ."en etails abo%t a
class$s internal implementation are isclose t"ro%g" t"e
inter'ace3
2;
Designing classes4 6e'ining attrib%tes

Attrib%tes ienti'ie in object-oriente analysis


m%st be re'ine .it" an eye on implementation
%ring t"is p"ase3

In t"e analysis p"ase& t"e name o' t"e attrib%te


is eno%g"3

5%t in t"e esign p"ase& etaile in'ormation


m%st be ae to t"e moel3

2"e 0 basic types o' attrib%tes are4

Single-(al%e attrib%tes

9%ltiplicity or m%lti(al%e attrib%tes

6e'erence to anot"er object or instance


connection
2<
Attrib%tes

Attrib%tes represent t"e state o' an object3

>"en t"e state o' t"e object c"anges& t"ese


c"anges are re'lecte in t"e (al%e o' attrib%tes3

Single (al%e attrib%te "as only one (al%e or


state3 +*g,3 Hame& aress& salary

9%ltiplicity or m%lti(al%e attrib%te can "a(e a


collection o' many (al%es at any time3

+*g, I' .e .ant to 7eep tact o' t"e names o'


people ."o "a(e calle a c%stomer s%pport line
'or "elp3
2=
9%lti (al%e attrib%te

Instance connection attrib%tes are re8%ire to


pro(ie t"e mapping neee by an object to
'%l'ill its responsibilities3

+*3g3, A person may "a(e one or more ban7


acco%nts3

A person "as )ero to many instance connections


to Acco%nt+s,3

Similarly& an Acco%nt can be assigne to one or


more person+s, +joint acco%nt,3

So an Acco%nt "as )ero to many instance


connection to !erson+s,3
2@
Designing met"os an protocols
A class can pro(ie se(eral types o' met"os4
Constr%ctor4 9et"o t"at creates instances +objects, o' t"e class
Destr%ctor4 2"e met"o t"at estroys instances
Con(ersion 9et"o4 2"e met"o t"at con(erts a (al%e 'rom one
%nit o' meas%re to anot"er3
Copy 9et"o4 2"e met"o t"at copies t"e contents o' one instance
to anot"er instance
Attrib%te set4 2"e met"o t"at sets t"e (al%es o' one or more
attrib%tes
Attrib%te get4 2"e met"o t"at ret%rns t"e (al%es o' one or more
attrib%tes
IIO met"os4 2"e met"os t"at pro(ie or recei(e ata to or 'rom a
e(ice
Domain speci'ic4 2"e met"o speci'ic to t"e application3
0A
!ac7ages an 9anaging Classes

A pac7age gro%ps an manages t"e moeling


elements& s%c" as classes& t"eir associations
an t"eir str%ct%res3

!ac7ages t"emsel(es may be neste .it"in


ot"er pac7ages3

A pac7age may contain bot" ot"er pac7ages


an orinary moel elements3

A pac7age pro(ies a "ierarc"y o' i''erent


system components an can re'erence ot"er
pac7ages3

Classes can be pac7age base on t"e ser(ices


t"ey pro(ie or gro%pe into t"e b%siness
classes& access classes an (ie. classes3
01
Access Layer4 Object storage an
object interoperability

A Date 5ase 9anagement System +D59S, is a


set o' programs t"at enables t"e creation an
maintenance +access& manip%late& protect an
manage, o' a collection o' relate ata3

2"e p%rpose o' D59S is to pro(ie reliable&


persistent ata storage an mec"anisms 'or
e''icient& con(enient ata access an retrie(al3

!ersistence re'ers to t"e ability o' some objects


to o%tli(e t"e programs t"at create t"em3

Object li'etimes can be s"ort 'or local objects


+calle transient objects, or long 'or objects
store ine'initely in a atabase +calle
persistent objects,3
02
!ersistent stores

9ost object-oriente lang%ages o not s%pport


seriali)ation or object persistence& ."ic" is t"e
process o' .riting or reaing an object to an
'rom a persistence storage mei%m& s%c" as
is7 'ile3

Unli7e object oriente D59S systems& t"e


persistent object stores o not s%pport 8%ery or
interacti(e %ser inter'ace 'acilities3

Controlling conc%rrent access by %sers&


pro(iing a-"oc 8%ery capability an allo.ing
inepenent control o(er t"e p"ysical location o'
ata are not possible .it" persistent objects3
00
Object store an persistence

At7inson escribe ; broa categories 'or t"e li'etime o' a


ata3

2ransient res%lts to t"e e(al%ation o' expressions

Gariables in(ol(e in proce%re acti(ation

1lobal (ariables an (ariables t"at are ynamically


allocate

Data t"at exist bet.een t"e exec%tion o' a program

Data t"at exist bet.een t"e (ersions o' a program

Data t"at o%tli(e a program3

2"e 'irst 0 are transient ata& ata t"at cease to exist


beyon t"e li'etime o' t"e creating process3 2"e ot"er 0
are nontransient& or persistent ata3

2"e programming lang%ages pro(ie excellent s%pport


'or transient ata3 2"e non-transient ata are .ell
s%pporte by D59S or a 'ile system3
04
Object li'etimes

Similarly objects "a(e a li'etime3 An object can exist 'or


a perio o' time +application session,3 An object can
also persist beyon application session bo%naries&
%ring ."ic" t"e object is store in a 'ile or a atabase3

*ssential elements in pro(iing a persistent store are 4

Ienti'ication o' persistent objects +object ID,

!roperties o' objects an t"eir interconnection3

Scale o' t"e object store3 2"e object store s"o%l ieally
pro(ie in'inite store3

2"e system s"o%l be able to reco(er 'rom %nexpecte


'ail%res an ret%rn t"e system to a recent sel'-consistent
state3
0:
Data 5ase 9anagement Systems

In traitional 'ile processing& eac" application e'ines


an implements t"e 'iles it re8%ires3

In D59S& a single repository o' ata is maintaine&


."ic" can be e'ine once an s%bse8%ently accesse
by (ario%s %sers3

D59S contains not only t"e ata b%t a a complete


e'inition o' t"e ata 'ormats it manages& 7no.n as
Sc"ema or 9eta-ata& ."ic" contains a complete
e'inition o' t"e ata 'ormats& s%c" as t"e ata
str%ct%res& types an constraints3

In 'ile processing applications& s%c" meta ata are


encaps%late in t"e application programs t"emsel(es3
5%t in D59S& t"e 'ormat o' t"e meta-ata is inepenent
o' any partic%lar application ata str%ct%re3
0;
Database Gie.s

D59S pro(ies t"e atabase %sers .it" a concept%al


representation t"at is inepenent o' t"e lo.-le(el etails
+p"ysical (ie., o' "o. t"e ata are store3 2"e
atabase pro(ies an abstract ata moel t"at %ses
logical concepts s%c" as 'iel& recors an tables an
t"eir interrelations"ips3 2"ese moels can be easily
%nerstoo by t"e %ser t"an t"e lo.-le(el storage
concepts3

2"is abstract ata moel can 'acilitate m%ltiple (ie.s o'


t"e same %nerlying ata3 *ac" application may be
intereste in only a s%bset o' t"e ata3 D59S can
pro(ie m%ltiple (ie.s +(irt%al, o' t"e ata t"at are
tailore to ini(i%al applications3
0<
Database 9oels

A atabase moel is a collection o' logical constr%cts


%se to represent t"e ata str%ct%re an ata
relations"ips .it"in t"e atabase3 2"e concept%al moel
'oc%ses on t"e logical nat%re o' t"at ata presentation3 It
is concerne .it" ."at is represente in t"e atabase
an t"e implementation moel is concerne .it" "o. it
is represente3

/ierarc"ical moel

2"is moel represents ata as a single roote tree3


*ac" noe in t"e tree represents a ata object an t"e
connection represents a parent-c"il relations"ip3

Het.or7 9oel

2"is is similar to a "ierarc"ical atabase& .it" one


i''erence3 /ere recor can "a(e more t"an one parent3
0=
6elational 9oel

It is simple an .iesprea3 /ere t"e relation


can be t"o%g"t o' as a table3 2"e col%mns o'
eac" table are attrib%tes t"at e'ine t"e ata or
(al%e omain 'or entries in t"at col%mn3 2"e
ro.s o' eac" table are t%ples representing
ini(i%al ata objects being store3 A relational
table s"o%l "a(e only one primary 7ey3 A
primary 7ey is a combination o' one or more
attrib%tes ."ose (al%e %nambig%o%sly locates
eac" ro. in t"e table3 A 'oreign 7ey is a primary
7ey o' one table t"at is embee in anot"er
table to lin7 t"e tables3
0@
Database Inter'ace

2"e inter'ace on a atabase m%st incl%e a ata e'inition


lang%age +DDL,& a 8%ery an ata manip%lation lang%age
+D9L,3 2"ese lang%ages m%st be esigne to re'lect t"e
'lexibility an constraints in"erent in t"e ata moel3
Databases "a(e aopte 2 approac"es 'or inter'aces .it" t"e
system3

One is to embe a atabase lang%age s%c" as str%ct%re


8%ery lang%age +SJL,& in t"e "ost programming lang%age3
2"e problem "ere is t"at application programmers "a(e to
learn an %se t.o i''erent lang%ages3 2"e application
programmers "a(e to negotiate t"e i''erences in t"e ata
moels an ata str%ct%res allo.e in bot" lang%ages3

Anot"er approac" is to exten t"e "ost programming


lang%age .it" atabase relate constr%cts3 /ere application
programmers nee to learn only a ne. constr%ct o' t"e same
lang%age rat"er t"an a completely ne. lang%age3 *g3
1emStone 'rom Ser(io Logic "as extene t"e Smalltal7
object-oriente programming3
4A
Database Sc"ema an Data
De'inition Lang%age

DDL is t"e lang%age %se to escribe t"e


str%ct%re o' an relations"ips bet.een objects
store in a atabase3 2"is str%ct%re o'
in'ormation is terme t"e atabase sc"ema3 In
traitional atabases& t"e sc"ema is t"e
collection o' recor types an set types or t"e
collection o' relations"ips an table recors to
store in'ormation abo%t entities o' interest to t"e
application3 *3g33 C6*A2* 2A5L* in(entory
+In(entoryKH%mber C/A6+1A, HO2 HULL
Description C/A6+2:, HO2 HULL !rice
D*CI9AL +@&2,,D
41
Data 9anip%lation Lang%age an
J%ery Capabilities

As7ing J%estions& 'ormally ma7ing 8%eries o' t"e ata #


is a typical an common %se o' a atabase3 A 8%ery is
expresse t"ro%g" a 8%ery lang%age3 A Data
9anip%lation Lang%age +D9L, is t"e lang%age t"at
allo.s %sers to access an manip%late +s%c" as cerate&
sa(e or estroy, ata organi)ations3 2"e SJL is t"e
stanar D9L 'or relational D59Ss3 2"e 8%ery %s%ally
speci'ies

2"e omain o' t"e isco%rse o(er ."ic" to as7 t"e 8%ery

2"e elements o' general interest

2"e conitions or constraints t"at apply

2"e orering& sorting or gro%ping o' elements an t"e


constraints t"at apply to t"e orering or gro%ping
42
D9L

J%ery processes "a(e sop"isticate BenginesC t"at


etermine t"e best .ay to approac" t"e atabase an
exec%te t"e 8%ery o(er it3 2"e may %se t"e in'ormation
in t"e atabase or 7no.lege o' t"e ."ereabo%ts o'
partic%lar ata in t"e net.or7 to optimi)e t"e retrie(al o'
a 8%ery3

D9L are eit"er proce%ral or nonproce%ral3 A


!roce%ral D9L re8%ires %sers to speci'y ."at ata are
esire an "o. to get t"e ata3

A non-proce%ral D9L re8%ires %sers to speci'y ."at


ata are neee b%t not "o. to get t"e ata3 Object-
oriente 8%ery an ata manip%lation lang%ages& s%c"
as Object SJL& pro(ie object management capabilities
to t"e ata manip%lation lang%age3
40
D9L

In a relational D59S& t"e D9L is inepenent o'


t"e "ost programming lang%age3 A "ost
lang%age s%c" as C or CO5OL .o%l be %se to
.rite t"e boy o' t"e application3 SJL
statements t"en are embee in C or CO5OL
applications to manip%late ata3 Once SJL is
%se to re8%est an retrie(e atabase ata& t"e
res%lts o' t"e SJL retrie(al m%st be trans'orme
into t"e ata str%ct%res o' t"e programming
lang%age3 2"e ra.bac7 "ere is t"at t"e
programmers coe "ere in t.o lang%ages& SJL
an t"e "ost lang%age3
44
Logical an !"ysical Database
Organi)ation an Access Control

Logical atabase organi)ation re'ers to t"e


concept%al (ie. o' atabase str%ct%re an
t"e relations"ips .it"in t"e atabase3
!"ysical atabase organi)ation re'ers to
"o. t"e logical components are
represente in a p"ysical 'orm by
operating system constr%cts eg objects
may be represente as 'iles3
4:
S"areability an 2ransactions

Data an objects in t"e atabase nee to be


accesse an s"are by i''erent applications3
>it" m%ltiple applications "a(ing access to t"e
object conc%rrently& it is li7ely t"at con'licts o(er
object access .ill arise3 2"e atabase m%st
etect an meiate t"ese con'licts an promote
maxim%m amo%nt o' s"aring .it"o%t any ata
integrity problem3 2"is meiation process is
manage t"ro%g" conc%rrency control policies&
implemente& by transactions3
4;
2ransactions

2ransaction is a %nit o' c"ange in ."ic" many ini(i%al


moi'ications are aggregate into a single moi'ication
t"at occ%rs in its entirety or not at all3 2"%s eit"er all
c"anges to objects .it"in a gi(en transaction are applie
to t"e atabase or none o' t"e c"anges3 A transaction is
sai to commit i' all c"anges can be mae s%ccess'%lly
to t"e atabase an to abort i' cancele beca%se all
c"ange to t"e atabase cannot be mae s%ccess'%lly3
2"is ability o' transactions ens%res atomicity o' c"ange
t"at maintains t"e atabase in a consistent state3

9any transaction systems are esigne 'or s"ort


transactions +lasting 'or min%tes,3 2"ey are less s%itable
'or long transactions& lasting "o%rs3 Object atabases
are esigne to s%pport bot" s"ort an long
transactions3 A conc%rrent control policy ictates ."at
"appens ."en con'licts arise bet.een transactions t"at
attempt to access to t"e same object an "o. t"ese
con'licts are to be resol(e3
4<
Conc%rrency !olicy

>"en se(eral %sers attempt to rea an .rite


t"e same object sim%ltaneo%sly& t"ey create a
contention 'or object3 2"en conc%rrency control
mec"anism is establis"e to meiate s%c"
con'licts by ma7ing policies t"at ictate "o. t"ey
.ill be "anle3

2o pro(ie consistent (ie.& t"e transactions


m%st occ%r in serial orer3 A %ser m%st see t"e
atabase as it exists be'ore a gi(en transaction
occ%rs or a'ter t"e transaction3
4=
Conc%rrency iss%es

2"e conser(ati(e .ay o' en'orcing seriali)ation is to


allo. a %ser to loc7 all objects or recors ."en t"ey are
accesse an to release t"e loc7s only a'ter a
transaction commits3 2"is is calle conser(ati(e or
pessimistic policy3 It pro(ies excl%si(e access to t"e
object& espite ."at is one to it3 2"e policy is
conser(ati(e beca%se no ot"er %ser can (ie. t"e ata
%ntil t"e object is release3

5y isting%is"ing bet.een 8%erying +reaing, t"e object


an .riting to it& greater conc%rrency can be ac"ie(e3
2"is policy allo.s many reaers o' an object b%t only
one .riter3
4@
Conc%rrency iss%es

Uner an optimistic policy& t.o con'licting transactions


are compare in t"eir entirety an t"en t"eir serial
orering is etermine3 A process can be allo.e to
obtain a rea loc7 on an object alreay .rite loc7e i' its
entire transaction can be seriali)e as i' it occ%rre
eit"er entirely be'ore or entirely a'ter t"e con'licting
transaction3 2"e re(erse also is tr%e3 A process may be
allo.e to obtain a .rite loc7 on an object t"at "as a
rea loc7 i' its entire transaction can be seriali)e as i' it
occ%rre a'ter t"e con'licting transaction3 Ho. t"e
optimistic policy allo.s more processes to operate
conc%rrently t"an t"e conser(ati(e policy3
:A
Distrib%te Databases an Client-
Ser(er Comp%ting

In istrib%te atabases& portions o' t"e


atabase resie on i''erent noes an
is7 ri(es in t"e net.or73 *ac" portion o'
t"e atabase is manage by a ser(er3
2"e ser(er sens in'ormation to client
applications an ma7es 8%eries or ata
re8%ests to t"ese client applications or
ot"er ser(ers3
:1
Client-Ser(er Comp%ting

It is t"e logical extension o' mo%lar programming3 In


mo%lar programming .e separate a large piece o'
so't.are into its constit%ent parts +mo%les,3 2"is ma7es
e(elopment easier an gi(es better maintainability3

In client-ser(er comp%ting all t"ose mo%les are not


exec%te .it"in t"e same memory space or e(en on t"e
same mac"ine3 /ere t"e calling met"o becomes
BclientC an t"e calle mo%le becomes t"e Bser(erC3
2"e important component o' client-ser(er comp%ting is
connecti(ity& ."ic" allo.s applications to comm%nicate
transparently .it" ot"er programs or processes&
regarless o' t"eir locations3 2"e 7ey element o'
connecti(ity is t"e net.or7 operating system +HOS,&
7no.n as mile.are3 2"e HOS pro(ies ser(ices s%c"
as ro%ting& istrib%tion& messages& 'iling& printing an
net.or7 management3
:2
Client-ser(er Comp%ting

Client programs manage %ser inter'ace portion o' t"e


application& (aliate ata entere by t"e %ser& ispatc"
re8%ests to ser(er program an exec%tes b%siness logic3
2"e b%siness layer contains all t"e objects t"at
represent t"e b%siness3 2"e client-base process is t"e
'ront-en o' t"e application& ."ic" t"e %ser sees an
interacts .it"3 It manages t"e local reso%rce .it" ."ic"
t"e %ser interacts& s%c" as t"e monitor& 7eyboar&
.or7station& C!U an perip"erals3 A 7ey component o'
a client .or7station is t"e grap"ical %ser inter'ace +1UI,3
It is responsible 'or etecting %ser actions& managing t"e
>ino.s on t"e isplay an isplaying t"e ata in t"e
>ino.s3 2"e ser(er process per'orms bac7-en tas7s3
:0
-ile ser(er Gs Database ser(er

2"e ser(er can ta7e i''erent 'orms3 2"e simplest 'orm


o' ser(er is a 'ile ser(er3 >it" a 'ile ser(er& t"e client
passes re8%ests 'or 'iles or 'ile recors o(er a net.or7 to
t"e 'ile ser(er3 2"is nees a large ban.it" an can
slo. o.n a net.or7 .it" many %sers3 2raitional LAH
comp%ting allo.s %sers to s"are reso%rces s%c" as ata
'iles an perip"eral e(ices3

A(ance 'orms o' ser(ers are atabase ser(ers&


transaction ser(ers& an application ser(ers an object
ser(ers3 >it" atabase ser(ers& clients pass SJL
re8%ests as messages to t"e ser(er an t"e res%lts o'
t"e 8%ery are ret%rne o(er t"e net.or73 5ot" t"e coe
t"at processes t"e SJL re8%est an t"e ata resie on
t"e ser(er& allo.ing it to s%e its o.n processing po.er to
'in t"e re8%este ata3 2"is is in contrast to t"e 'ile
ser(er& ."ic" re8%ires passing all t"e recors bac7 to t"e
client an t"en letting t"e client 'in its o.n ata3
:4
2ransaction Ser(ers

>it" transaction ser(ers& clients in(o7e remote


proce%res t"at resie on ser(ers& ."ic" also contain an
SJL atabase engine3 2"e ser(er "as proce%ral
statements to exec%te a gro%p o' SJL statements
+transactions,& ."ic" eit"er all s%ccee or 'ail as a %nit3

Applications base on transaction ser(ers& "anle by


on-line transaction processing +OL2!,& ten to be
mission-critical applications t"at al.ays re8%ire a 1-0
secon response time an tig"t control o(er t"e sec%rity
an integrity o' t"e atabase3 2"e comm%nication
o(er"ea in t"is approac" is 7ept to a minim%m& since
t"e exc"ange consists o' a single re8%est an reply +as
oppose to m%ltiple SJL statements in atabase
ser(ers,3
::
H-tier arc"itec%tre

In a t.o-tier arc"itect%re& a client tal7s irectly to a


ser(er& .it" no inter(ening ser(er3 2"is type o'
arc"itect%re is %se in small en(ironments .it" less t"an
:A %sers3 2o scale %p to "%nres or t"o%sans o'
%sers& it is necessary to mo(e to a 0-tier arc"itect%re3

2"ree-tier arc"itect%re intro%ces a ser(er bet.een t"e


client an t"e ser(er3 2"e role o' t"e application or >eb
ser(er is mani'ol3 It can pro(ie translation ser(ices&
metering ser(ices +transaction monitor to limit t"e
n%mber o' sim%ltaneo%s re8%ests to a gi(en ser(er, or
intelligent agent ser(ices +mapping a re8%est to a
n%mber o' i''erent ser(ers& collating t"e res%lts& an
ret%rning a single response to t"e client,3
:;
5asic c"aracteristics o' client-
ser(er arc"itect%res

2"e client process contains sol%tion-speci'ic logic an


pro(ies t"e inter'ace bet.een t"e %ser an t"e rest o'
t"e application system3 2"e ser(er process acts as a
so't.are engine t"at manages s"are reso%rces s%c" as
atabases& printers& moems or processors3

2"e 'ront en tas7 an bac7-en tas7 "a(e


'%namentally i''erent re8%irements 'or comp%ting
reso%rces s%c" as processor spees& memory& is7
spees an capacities an iIo e(ices3

2"e en(ironment is "eterogeneo%s an m%lti(enor3


2"e "I. plat'orm an oIs o' client an ser(er are not t"e
same3

2"ey can be scale "ori)ontally an (ertically3


/ori)ontal scaling means aing or remo(ing client
.or7stations .it" only a slig"t per'ormance impact3
Gertical scaling means migrating to a larger an 'aster
ser(er mac"ine3
:<
Distrib%te an Cooperati(e
!rocessing

Distrib%te processing means istrib%tion o'


applications an b%siness logic across m%ltiple
processing plat'orms3 It implies t"at processing
.ill occ%r on more t"an one processor to
complete a transaction3 2"e processing is
istrib%te across 2 or more mac"ines& ."ere
eac" process per'orms part o' an application in
a se8%ence3 2"ese processes may not r%n at
t"e same time3

Cooperati(e processing is comp%ting t"at


re8%ires t.o or more istinct processors to
complete a single transaction3 /ere programs
interact an exec%te conc%rrently on i''erent
processors
:=
Distrib%te Objects Comp%ting

/ere ser(ers are plenti'%l instea o' scarce an


proximity no longer matters3 2"is is %e to t"e
gro.t" o' net.or7s an net.or7 a.are
m%ltit"reae es7top operating systems3

Distrib%te Object Comp%ting %tili)es re%sable


so't.are components t"at can roam any."ere
on t"e net.or7s& r%n on i''erent plat'orms&
comm%nicate .it" legacy applications by means
o' object .rappers an manage t"emsel(es an
t"e reso%rces t"ey control3
:@
Distrib%te Objects Comp%ting

/ere applications no longer consists o' clients an


ser(ers b%t %ses& objects an met"os3 2"e %ser no
longer nees to 7no. ."ic" ser(er process per'orms a
gi(en '%nction3 All in'ormation abo%t t"e '%nction is
"ien insie t"e encaps%late object3 A message
re8%esting an operation is sent to t"e object an
appropriate met"o is in(o7e3

2"e in'ormation systems m%st lin7 applications


e(elope in i''erent lang%ages& %se ata 'rom object
an relational atabases an 'rom main'rame systems&
an be optimi)e 'or %se across t"e Internet an t"ro%g"
epartmental intranets3
;A
CO65A

In 1@=@& t"e Object 9anagement 1ro%p +O91,&


.it" o(er :AA member companies& speci'ie t"e
arc"itect%re 'or an open so't.are b%s on ."ic"
object components .ritten by i''erent (enors
can operate across net.or7s an operating
systems3

C%rrently se(eral DOC stanars are competing&


incl%ing CO65A& OpenDoc an 9icroso't$s
Acti(eLIDCO93 2"e slo. aoption o' DOC are
%e to close legacy arc"itect%re& incompatible
protocols& inae8%ate net.or7 ban.it"s an
sec%rity iss%es3
;1
Common Object 6e8%est 5ro7er
Arc"itect%re

It is %se to integrate istrib%te& "eterogeneo%s


b%siness applications an ata3 2"e CO65A
inter'ace e'inition lang%age +IDL, allo.s
e(elopers to speci'y lang%age-ne%tral& object-
oriente inter'aces 'or application an system
components3 IDL e'initions are store in an
inter'ace repository t"at o''ers object inter'aces
an ser(ices3 -or istrib%te enterprise
comp%ting& t"e inter'ace repository is central to
comm%nication among objects locate on
i''erent systems3
;2
Common Object *n(ironment

CO65A implements a comm%nication


c"annel t"ro%g" ."ic" applications can
access object inter'aces an re8%est ata
an ser(ices3 2"e CO65A common
object en(ironment +CO*, pro(ies
system le(el ser(ices s%c" as li'e cycle
management 'or objects accesse
t"ro%g" CO65A& e(ent noti'ication
bet.een objects an transaction an
conc%rrency control3
;0
9icroso't$s Acti(eLIDCO9

9icroso't$s Component Object 9oel


+CO9, an its s%ccessor& t"e istrib%te
component object moel +DCO9, are
alternati(e to CO6 5A3 DCO9 .as
b%nle .it" >ino.s H2 43A3 DCO9 is
an Internet an component strategy ."ere
Acti(eL +'ormerly 7no.n as object lin7ing
an embeing or OL*, plays t"e role o'
DCO9 object3 DCO9 is bac7e by .eb
bro.ser +Internet *xplorer,3
;4
Object Oriente Database
9anagement Systems

It is marriage o' object oriente programming


an atabase tec"nology3 2"e e'ine
operations apply %ni(ersally an are not
epenent on t"e partic%lar atabase application
r%nning at t"e moment3 2"e ata types can be
extene to s%pport complex ata s%c" as
m%ltimeia by e'ining ne. object classes t"at
"a(e operations to s%pport ne. 7ins o'
in'ormation3 It s"o%l "a(e object-oriente
lang%age properties an atabase re8%irements3
;:
6%les to ma7e object-oriente system

2"e system m%st s%pport complex objects3 System


m%st pro(ie simple atomic types o' objects +integers&
c"aracters& etc, 'rom ."ic" complex objects can be b%ilt
by applying constr%ctors to atomic objects3

Object ientity m%st by s%pporte4 A ata object m%st


"a(e an ientity an existence inepenent o' its (al%es3

Objects m%st be encaps%late4 An object m%st


encaps%late bot" a program an its ata3

System m%st s%pport types or classes4 2"e system


m%st s%pport eit"er t"e type concept or class concept

System m%st s%pport in"eritance4 Classes an types


can participate in a class "ierarc"y3 In"eritance 'actors
o%t s"are coe an inter'aces3
;;
5ining+s,

System m%st a(oi premat%re bining4 2"is is also


7no.n as late bining or ynamic bining3 It s"o.s t"at
t"e same met"o name can be %se in i''erent classes3
2"e system m%st resol(e con'licts in operation names at
r%n time3

System m%st be comp%tationally complete4 Any


comp%table '%nction s"o%l be expressible in D9L o' t"e
system& allo.ing expression o' any type o' operation3

System m%st be extensible4 2"e %ser o' t"e system


s"o%l be able to create ne. types t"at "a(e e8%al
stat%s to t"e system$s pree'ine types3
;<
2"e r%les o' D59S

It m%st be persistent& able to remember an object state4


System m%st allo. t"e programmer to "a(e ata s%r(i(e
beyon t"e exec%tion o' t"e creating process 'or it to be
re%se in anot"er process3

It m%st be able to manage large atabases4 System


m%st manage access to t"e seconary storage an
pro(ie per'ormance 'eat%res s%c" as inexing&
cl%stering& b%''ering an 8%ery optimi)ation3

It m%st accept conc%rrent %sers4 System m%st allo.


m%ltiple conc%rrent %sers an s%pport notions o' atomic&
seriali)able transactions

9%st be able to reco(er 'rom "ar.are an so't.are


'ail%res

Data 8%ery m%st be simple4 System m%st pro(ie some


"ig"-le(el mec"anism 'or a-"oc bro.sing o' t"e
contents o' t"e atabase3
;=
Object oriente atabases (ers%s
2raitional Databases

2"e responsibility o' an OOD59S incl%es e'inition o'


t"e object str%ct%res& object manip%lation an reco(ery&
."ic" is t"e ability to maintain ata integrity regarless
o' system& net.or7 or meia 'ail%re3 2"e OOD59s li7e
D59Ss m%st allo. 'or s"aringD sec%re& conc%rrent
m%lti%ser accessD an e''icient& reliable system
per'ormance3

2"e objects are an Bacti(eC component in an object-


oriente atabase& in contrast to con(entional atabase
systems& ."ere recors play a passi(e role3 Anot"er
'eat%re o' object-oriente atabase is in"eritance3
6elational atabases o not explicitly pro(ie in"eritance
o' attrib%tes an met"os3
;@
Object Ientity

Object oriente atabases allo.


representation an storage o' ata in t"e
'orm o' objects3 *ac" object "as its o.n
ientity or object-ID +as oppose to t"e
p%rely (al%e-oriente approac" o'
traitional atabases,3 2"e object ientity
is inepenent o' t"e stat o' t"e object3
<A
Object 6elational Systems

C%rrently many applications are e(elope in an


object-oriente programming tec"nology3 5%t
t"ey access t"e ata t"at line in a relational
atabase3 2"is leas to a mismatc" bet.een
t"e programming moel +objects, an t"e .ay in
."ic" t"e existing ata are store +relational
tables,3 2o resol(e t"is .e nee a mapping tool
bet.een application objects an relational ata3

Creating an object moel 'rom an existing


relational atabase layo%t +sc"ema, is calle as
re(erse engineering3 Creating a relational
sc"eme 'rom an existing object moel is calle
as 'or.ar engineering3
<1
Object 6elational 9apping

2"e main tas7 o' t"ese tools is e'ining t"e relations"ip


bet.een t"e table str%ct%res +sc"emata, in t"e relational
atabase .it" classes in t"e object moel3 S%n$s Ma(a
5len is an example o' s%c" a tool3 It allo.s e(eloper
access to relational ata as Ma(a objects&

Object 6elation 9apping

In a relational atabase& t"e sc"ema is mae %p o'


tables& consisting o' ro.s an col%mns& ."ere eac"
col%mn "as a name an a simple ata type3 In an object
moel& t"e co%nterpart to a table is a class& ."ic" "as a
set o' attrib%tes +properties or ata members,3 Object
classes escribe be"a(ior .it" met"os3
<2
Store !roce%re

A t%ple +ro., o' a table contains ata 'or a single entity


t"at correlates to an object +instance o' a class, in an
object-oriente system3

A store proce%re in a relational atabase may


correlate to a met"o in an object-oriente arc"itect%re3
A store proce%re is a mo%le o' precompile SJL
coe maintaine .it"in t"e atabase t"at exec%tes on
t"e ser(er to en'orce r%les t"e b%siness "as set abo%t
t"e ata3 2"%s t"e mappings essential to object an
relational integration are bet.een a table an a class&
bet.een col%mns an attrib%tes& bet.een a ro. an an
object& an bet.een a store proce%re an a met"o3
<0
2able-Class mapping

A tool to map relational ata .it" objects s"o%l "a(e


t"e 'ollo.ing mapping capabilities4 +all are t.o
mappings,

2able-class mapping

2able-m%ltiple classes mapping

2able-in"erite classes mapping

2ables-in"erite classes mapping

2"e tool m%st escribe bot" "o. t"e 'oreign 7ey can be
%se to na(igate among classes an instances in t"e
mappe objects moel an "o. re'erential integrity is
maintaine3 6e'erential integrity mans ma7ing s%re t"at
a epenent table$s 'oreign 7ey contains a (al%e t"at
re'ers to an existing (ali t%ple in anot"er relation3
<4
2able-Class 9apping

It is a simple one-to-one mapping o' a table to a


class an t"e mapping o' col%mns in a table to
properties in a class3 /ere .e map all col%mns
to properties3 5%t it is more e''icient to map only
t"ose col%mns 'or ."ic" an object moel is
re8%ire by t"e application+s,3 /ere eac" ro. in
t"e table represents an object instance an eac"
col%mn in t"e table correspons to an object
attrib%te3 2"is pro(ies a literal translation
bet.een a relational ata representation an an
application object3
<:
2able-9%ltiple Classes 9apping

/ere a single table maps to m%ltiple nonin"eriting


classes3 2.o or more istinct& nonin"eriting classes
"a(e properties t"at are mappe to col%mns in a single
table3 At r%n time& mappe table ro. is accesse as an
instance o' one o' t"e classes& base on a col%mn (al%e
in t"e table3

2able-In"erite Classes 9apping

/ere& a single table maps to many classes t"at "a(e a


common s%perclass3 2"is mapping allo.s t"e %ser to
speci'y t"e col%mns to be s"are among relate classes3
2"e s%perclass may be eit"er abstract or instantiate
<;
2ables-In"erite Classes 9apping

2"is mapping allo.s t"e translation o' is-a relations"ips


t"at exist among tables in t"e relational sc"ema into
class in"eritance relations"ips in t"e object moel3 In a
relational atabase& an is-a relations"ip o'ten is
moele by a primary 7ey t"at acts as a 'oreign 7ey to
anot"er table3 In t"e object-moel& is-a is anot"er term
'or an in"eritance relations"ip3

?eys 'or Instance Ha(igation

In mapping col%mns to properties& t"e simple approac"


is to translate a col%mn$s (al%e into t"e corresponing
class property (al%e3 /ere eit"er t"e col%mn is a ata
(al%e or it e'ines a na(igable relations"ip bet.een
instances +'oreign 7ey,3 A 'oreign 7ey e'ines a
relations"ip bet.een tables in a relational atabase3 In
an object moel& t"is association is ."ere objects can
"a(e re'erences to ot"er objects t"at enable instance-to-
instance na(igation3
<<
9%ltiatabase Systems

A i''erent approac" 'or integration object-oriente


applications .it" relational ata en(ironments is
m%ltiatabase systems or "eterogeneo%s atabase
systems& ."ic" 'acilitate t"e integration o'
"eterogeneo%s atabases an ot"er in'ormation
so%rces3

/eterogeneo%s in'ormation systems 'acilitate t"e


integration o' "eterogeneo%s in'ormation so%rces& ."ere
t"ey can be str%ct%re +"a(ing reg%lar sc"ema,& semi-
str%ct%re an sometimes e(en %nstr%ct%re3 Some
"eterogeneo%s in'ormation systems are constr%cte on a
global sc"ema o(er se(eral atabases3 So %sers can
"a(e t"e bene'its o' a atabase .it" a sc"ema to access
ata store in i''erent atabases an cross atabase
'%nctionality3 S%c" "eterogeneo%s in'ormation systems
are re'erre to as 'eerate m%ltiatabase systems3
<=
-eerate 9%lti Data 5ase

-eerate m%ltiatabase systems pro(ie %ni'orm


access to ata store in m%ltiple atabases t"at in(ol(e
se(eral i''erent ata moels3 A m%ltiatabase system
+9D5S, is a atabase system t"at resies %nobtr%si(ely
on top o'& existing relational an object atabases an
'ile systems +local atabase systems, an presents a
single atabase ill%sion to its %sers3 2"e 9D5S
maintains a single global atabase sc"ema an local
atabase systems maintain all %ser ata3 2"e sc"ematic
i''erences among local atabases are "anle by
ne%trali)ation +"omogeni)ation,& t"e process o'
consoliating t"e local sc"emata3
<@
9D5S

2"e 9D5S translates t"e global 8%eries an


%pates 'or ispatc" to t"e appropriate local
atabase system 'or act%al processing& merges
t"e res%lts 'rom t"em an generates t"e 'inal
res%lt 'or t"e %ser3 9D5S coorinates t"e
committing an aborting o' global transactions
by t"e local atabase systems t"at processe
t"em to maintain t"e consistency o' t"e ata
.it"in t"e local atabases3 An 9D5S controls
m%ltiple gate.ays +or ri(ers,3 It manages local
atabases t"ro%g" gate.ays& one gate.ay 'or
eac" local atabase3
=A
Open Database Connecti(ity

Open Data 5ase Connecti(e +OD5C, is an application


programming inter'ace t"at pro(ies sol%tions to t"e
m%ltiatabase programming problem3 It pro(ies a
(enor-ne%tral mec"anism 'or inepenently accessing
m%ltiple atabase "osts3

OD5C an ot"er A!Is pro(ie stanar atabase access


t"ro%g" a common client-sie inter'ace3 It a(ois t"e
b%ren o' learning m%ltiple atabase A!Is3 /ere one
can store ata 'or (ario%s applications or ata 'rom
i''erent so%rces in any atabase an transparently
access or combing t"e ata on an as neee basis3
Details o' bac7-en ata str%ct%re are "ien 'rom t"e
%ser3
=1
OD5C

OD5C is similar to >ino.s print moel& ."ere t"e


application e(eloper .rites to a generic printer inter'ace
an a loaable ri(er maps t"at logic to "ar.are-
speci'ic commans3 2"is approac" (irt%ali)es t"e target
printer or D59S beca%se t"e person .it" t"e speciali)e
7no.lege to ma7e t"e application logic .or7 .it" t"e
printer or atabase is t"e ri(er e(eloper an not t"e
application programmer3 2"e application interacts .it"
t"e OD5C ri(er manager& ."ic" sens t"e application
calls +s%c" as SJL statements, to t"e atabase3 2"e
ri(er manager loas an %nloas ri(ers& per'orm
stat%s c"ec7s an manages m%ltiple connections
bet.een applications an ata so%rces3
=2
Designing Access Layer Classes

2"e main iea be"in creating an access layer is to


create a set o' classes t"at 7no. "o. to comm%nicate
.it" t"e place+s, ."ere t"e ata act%ally resie3
6egarless o' ."ere t"e ata resie& ."et"er it be a 'ile&
relational atabase& main'rame& Internet& DCO9 or (ia
O65& t"e access classes m%st be able to translate any
ata-relate re8%ests 'rom t"e b%siness layer into t"e
appropriate protocol 'or ata access3 2"ese classes
also m%st be able to translate t"e ata retrie(e bac7
into t"e appropriate b%siness objects3 2"e access
layer$s main responsibility is to pro(ie a lin7 bet.een
b%siness or (ie. objects an ata storage3 2"ree-layer
arc"itect%re is similar to 0-tier arc"itect%re3 2"e (ie.
layer correspons to t"e client tier& t"e b%siness layer to
t"e application ser(er tier an t"e access layer per'orms
t.o major tas7s4
=0
Designing Access Layer Classes

2ranslate t"e re8%est4 2"e access layer m%st be able to


translate any ata relate re8%ests 'rom t"e b%siness
layer into t"e appropriate protocol 'or ata access3

2ranslate t"e res%lts4 2"e access layer also m%st be


able to translate t"e ata retrie(e bac7 into t"e
appropriate b%siness objects an pass t"ose objects
bac7 into t"e b%siness layer3

/ere esign is tie to any base engine or istrib%te


object tec"nology s%c" as CO65A or DCO93 /ere .e
can s.itc" easily 'rom one atabase to anot"er .it" no
major c"anges to t"e %ser inter'ace or b%siness layer
objects3 All .e nee to c"ange are t"e access classes$
met"os3

También podría gustarte