Object SQL - A Language for the Design and Implementation of Object Databases

of 23
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Travel

Published:

Views: 7 | Pages: 23

Extension: PDF | Download: 0

Share
Description
Object SQL - A Language for the Design and Implementation of Object Databases
Tags
Transcript
   li W HEWLETT   P K RD ObjectSQL Language for the  esignand mplementation of Object  atabases  urgen Annevelink,RafiulAhad*,AmeliaCarlson*,  an Fishman,MikeHeytens,WilliamKentSoftwareTechnologyLaboratoryHPL-94-02March,1994objectdatabases,querylanguage,informationservices,distributedenvironment,relationaldatabasesObjectSQL(OSQL)isalanguagefor the design and implementationofobjectdatabases.TheOSQLlanguageiscomputationallycomplete and providesarich set ofconstructs that allowdefinition,implementation and integrationofinformationservices in adistributedenvironment.   alsoprovidesadeclarativequerycapability,similarto that providedbySQLforrelationaldatabases.This chapter includesexamplesofOSQLtypes and functionsused in actualdistributedapplications,basedonHewlett-Packard sOpenODBimplementationofOSQL. Tobepublishedin the  M PressBooks  Association for  omputing Machinery ,  DatabaseChallengesfor the 90 s editedbyWonKim,*CooperativeComputingSystemsDivision,Cupertino,CA © CopyrightHewlett-PackardCompany1994 Internal Accession Date Only   ntroduction ObjectSQL OSQL isadatabase programming languagethatcombinesanexpression-orientedprocedurallanguagewithahigh-level,declarativeandoptimizablequerylanguage.TheOSQLlanguagecombinestheobject-orientedfeaturesfoundinsuchlanguagesas c [EllisandStroustrup1990] and Smalltalk[GoldbergandRobson1983]withaquerycapabilitythatisasuperset of thefamiliarSQLrelationalquerylanguage.Consequently,OSQLprovidesmany of theadvantages of objectorientation,includingamoreintuitivemodel,improvedproductivity,codereuseandextensibility,togetherwithallthefeatures of currentdatabasetechnology,suchasqueryoptimization,integrityconstraints,multi-useraccess,authorizationandsecurity.  he OSQLlanguagewasdevelopedaspart of theIrisprojectatHewlett-PackardLaboratories[Fishmanetal.1989;Lyngbaek1991;Wilkinson,LyngbaekandHasan1990].   hasevolvedtoincludegeneralcomputationalprimitives[Annevelink1991]andisnowacomputationallycomplete,extensibledatabaselanguage.Thedesign of OSQLwasinfluencedbypioneeringworkonsemanticandfunctionaldatabasemodels,notablythefunctionallanguageDaplex[Shipman1981]andthelanguageTaxis[Mylopoulos,BernsteinandWong1980].ThedesigngoalsforOSQLcanbesummarizedasfollows:•basedonasimple,orthogonalobject-orientedmodelandtypesystem•computationallycompleteandindependent of specificapplicationprogramminglanguages•providesconstructsforspecifyingdeclarativequeriesandallowssuchqueriestobecompiledandoptimized,similartothecapabilitiesofferedbyrelationalquerylanguages•extensible,thatisallowstheuserto dynamically definenewtypesandoperations•noartificialdistinctionsbetweenmeta-dataobjectsanduser-definedobjects•allowsseparatedefinition of theinterface of anobject type andthecorrespondingimplementation s .OSQLisobject-orientedinthatitprovidesobjectidentity,atypesystemwithmultipleinheritance,polymorphicfunctionsandbuilt-inaggregateobjecttypessuchassetsandlists.   differsfromotherobject-orientedlanguages,inparticularC++,inthatitdoesnotmixthedefinition of theinterface of anobjecttypewithaparticularrepresentation of theinstances of thetype.OSQLallowstheinterfaceofanobjecttypetobedefinedindependent of aspecificchoiceforimplementingtheinterfaceandallowstheimplementationtochangeovertimel.InOSQL,thestate of anobjectisnotanintrinsicpart of theobjectitself;rather,itisdefinedbyfunctionswhichmodelattributes of theobject,interobjectrelationships,andarbitrarycomputations.Bydisassociatingtheinterface of anobjecttypefromanyspecificrepresentation of theinstances of thetype,onecanallowobjectstodynamicallyacquireandlosetypes,thusenablingonetomodeltheevolution of objectsovertheirlifetimeinanaturalway.TheOSQL ty systemallowstheOSQLcompilertodocompile-timetypechecking.However,sinceOSQLallowsobjects,includingtypesandfunctions,tobecreateddynamically,compile-timetypechecking  s tobesupplementedbyrun-timetypechecks.Functionsareamajormodellingconstruct of OSQLandareusedtomodelattributes of theobject,interobjectrelationships,andarbitrarycomputations.Functionscanbeimplementedasstoredfunctions e.g.bystoringadirectrepresentation of therelationshipintheform of atableinthedatabase orthey 1.Futureversions of thelanguagemayincludeadditionalconstructstoallowthespecificationofmultipleimplementationsofagiveninterface. 2  canbecomputed.Theimplementationofacomputedfunctionisspecifiedbyanexpression,the  o y ofthefunction;thefreeidentifiersinthisexpressionaretheformalparametersofthefunctionandthevaluecomputedbytheexpressionisthevaluereturnedbythefunction.Thebodyofacomputedfunctionmayincludequeryexpressions.Inadditiontostoredandcomputedfunctions,OSQLalsosupportsexternalfunctions.Externalfunctionsprovideacrucialmeasureofextensibility,becausetheyallowafunctionto be implementedbyaroutinewritteninanexternalprogramminglanguage e.g.C,C++orCOBOL).TheOSQLauthorizationmechanismisalsodesignedaroundfunctions[Ahadetal.1992].UsersaremembersofUserGroup sthatareassignedcalland/orupdateprivilegestofunctions.TheOSQLauthorizationmechanismisnotfurtherdiscussedinthischapter.TheOSQLlanguageisindependentofspecificapplicationprogramminglanguages  e.g. C,C++,Smalltalk,COBOL)andspecificimplementations.Theexamples used inthischapterareslightlystylizedversionsofactualOSQLfunctionsusedbyapplicationsrunningontopofOpenODB,HewlettPackard sobject-orienteddatabasemanagementsystemandimplementationofOSQL[AhadandDedo1992;AhadandCheng1993;Hewlett-Packard  992] Theprogrammaticinterfaceprovidedby OpenODB allowsclientapplicationstocallanyOSQLfunctionandmaptheresultsreturnedbyOSQLfunctionstothedata-typesprovidedbytheprogramminginterface.  n thischapterwewillgiveanoutlineoftheOSQLmodel section 2), followedbyadiscussionofthemajorconstructsfoundintheOSQLlanguage section 3), withspecialattentiontothe select construct section 4). Insection 5 wewillgiveanumberofexampleshighlightingsomeofthemoreadvancedapplicationsmadepossiblebyOSQL.  OSQ ObjectModel TheOSQLlanguageiscenteredaroundthreebasicconcepts:objects,typesandfunctions.Objects,typesandfunctions  re relatedasshowninFigure1. FunctionSignatureType FIGURE1. OSQL- basic  t modelelements  n relationships 3   bjects Objectsrepresentthereal-worldentitiesandconceptsfromtheapplicationdomainthatthedatabaseisstoringinformationaboutForexample,inaclinicaldatabase,objectsmayrepresentclinics,physicians,nurses,patients,problemlists,andsoon.InOSQL,objectscanbeclassifiedinoneofthreecategories:•literals,forexample,integers,characterstringsandbinaryobjects•aggregates,forexample,aproblemlistoratuplecontainingdemographic data forapatient,suchasname,ageandsocialsecuritynumber•surrogates,forexample,patientsandclinicsSurrogateobjectsarecharacterizedbyasystem-generated,uniqueobjectidentifier oid).SurrogateobjectsalsorepresententitiesusedtoimplementOSQL,e.g. system typesandfunctions.Surrogateobjectsareexplicitlycreatedanddeleted.  yp s ThesecondmajorconceptinOSQListhatofatype.  ypes areusedtoclassifyobjectsonthebasisofsharedpropertiesand/orbehavior.Forexample,itisnaturaltogrouptogetherallpatientobjectsandsimilarlygroupallphysicianobjects,allnurseobjectsandallclinicobjects.  yp s arealsoused to definethesignatureoffunctions i.e.theirargumentandresulttype).Theextensionofatypeisthesetofobjectsthatareinstancesofthetype.Sometypes,forexampleInteger,havepre-definedextensions.Surrogatetypeshave dyn mic extensionsthatchangedependingonthetype s)andorderin which objectsarecreatedanddeleted.Aggregatetypesandaggregateobjectscanbeconstructedfromothertypesandobjectsrespectively,usingsystemdefinedaggregatetypeandobjectconstructors .Forexample,aninstanceofthetype SetType  Small Integer isdenotedbytheexpression: Set 1,2, 3 . Notethatthisdoesnotconstructanewobject,butratherreturnsaspecificobjectfromtheextentofthetype SetType  SmaIIInteger , inthesamewaythattheexpression1doesnotreturnanewobjectbutreturnsaninstanceofthetype SmallInteger.  ypes arerelatedinasubtype/supertypehierarchythatsupportsmultipleinheritance.Thetypehierarchyenforcestypecontainment,thatis,ifanobject  s aninstanceofagiventypeT,itmustalsobeaninstanceofallsupertypesofthetypeT.  n overviewofthe pre-defined)systemtypehierarchyisshowninFigure2.User-definedtypescanbeaddedassubtypesofthetype Usersurrogate . OSQLsurrogateobjectscanbeinstancesofanynumberoftypes,evenifthetypesarenotrelatedbyasubtype/supertyperelationship.Thisisobviouslyrequiredintherealworld,wheresayapersonmaybelongtomanydifferentgroups,andassumedifferentrolesdependingonthecontext.Forexample,thegroupofcancerpatientscanbedistinguishedfromthegroupofdiabetics;differenttypesofpropertiesareapplicableandrelevanttoeachofthe members ofthetwo.Moreover,peoplecanchangetheirmembershipinagroupandthuschangewhatrolesandwhatpropertiesandbehaviorareapplicable.Forexample,apersoncanbecuredandthusnolongerbeacancerpatientorhecangetsickandbediagnosedwithdiabetes.  unctions Thethirdconcept,functions,isusedtomodelattributesoftheobject,interobjectrelationships,andarbitrarycomputations.OneofthekeydistinctionsofOSQLascomparedtoothermodels e.g,thoseinspiredbyobject-orientedprogramminglanguages)isthisunifying notion ofafunction to model 2.OpenODBsupportsfouraggregatetypeandobjectconstructors,BagType,SetType,ListTypeandTupleType to constructaggregatetypesandBag,Set,ListandTupletoconstructthecorrespondingobjects.3.Theversion ofOSQL implementedbyOpenODBcurrentlydoesnotallowthecreationofuser-definedsubtypesofpre-definedsystemtypes.4
Recommended
View more...
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks