遍歷表達式含義SQL代碼anAirline.Emploee給定的一條航線,找出相應(yīng)的員工。SELECT employeeID FROM Employee WHERE arilineID = :anAirline;anAirline.Employee.name給定的一條航線,找出相應(yīng)的員工的名字。SELECT name FROM Employee WHERE airlineID = :anAirline;anAirline.Flight
[getMonth(date)==aMonth].pilot找出在某個給定的月份里為一條航行飛行的機師。SELECT pilotID FROM Flight WHERE airlineID = :anAirline AND GetMonth(date) = :aMonth;anAirline.Flight
[getMonth(date)==aMonth].pilot[flightRating==aFlightRating]找出在某個給定的月份里為一條航線飛行的在一個給定的飛行等級里的機師。SELECT P.pilotID FROM Flight F, Pilot P WHERE F.airlineID = :anAirline AND getMonth(F.date) = :aMonth AND F.pilotID = P.pilotID AND P.flightRating = :aFlightRating;aFlight.copilot:Employee.name為一次飛行找出副機師的名字。SELECT E.name FROM Flight F, Pilot P, Employee E WHERE F.flightID = :aFlight AND F.copilotID = P.pilotID AND P.pilotID = E.employeeID;圖14 對象模型遍歷和SQL代碼的例子。 QQread.com 推出各大專業(yè)服務(wù)器評測 Linux服務(wù)器的安全性能 SUN服務(wù)器 HP服務(wù)器 DELL服務(wù)器 IBM服務(wù)器 聯(lián)想服務(wù)器 浪潮服務(wù)器 曙光服務(wù)器 同方服務(wù)器 華碩服務(wù)器 寶德服務(wù)器 4. RDBMS的OO擴展
抽象數(shù)據(jù)類型(ADT)。這是個好主意,擴展RDBMS的能力。開發(fā)商為這個技術(shù)使用了許多名字,例如Oracle cartridge和Informix data blades。ADT的缺點是它們把你緊緊綁在特定的一個開發(fā)商上;ADT的范疇超越了SQL標(biāo)準(zhǔn)。因此,你應(yīng)該只在ADT的好處很明顯的時候才使用。
Michael Blana是紐約Schenectady的通用電氣研發(fā)部的畢業(yè)生(譯者按:這是作者幽默的說法,意思是他已經(jīng)跳槽了)。在過去的五年里,他已經(jīng)成為面向?qū)ο蠹夹g(shù)、建模、數(shù)據(jù)庫設(shè)計和逆向工程領(lǐng)域的獨立的產(chǎn)業(yè)顧問。Blaha博士是多篇論文、五個專利和兩本書的作者。可以通過www.omtassociates.com或blaha@acm.org和他聯(lián)系。
William Premerlani從1975年開始就在通用電氣研發(fā)部供職。他的主要研究愛好在軟件工程、元建模(metamodeling)、數(shù)據(jù)庫技術(shù)和復(fù)雜工程應(yīng)用等領(lǐng)域。Premerlani博士是許多論文、二十五個專利和兩本書的作者。通過premerlani@acm.org和他聯(lián)系。
參考資料
[i]Michael Blaha and William Premerlani. Object-Oriented Design of Database applications. Rose Architect 1,2 (Winter, 1999).
[ii] PPS Chen. The Entity-Relationship model - toward a unified view of data. ACM Transactions on Database Systems1, 1 (March 1976).
[iii] Michael Blaha and William Premerlani. Object-Oriented Modeling and Design for Database Applications, Prentice Hall, Englewood Cliffs, New Jersey, 1998.
[iv] CJ Date. Don't mix pointers and relations! Presentation at Third Annual Object/Relational Summit sponsored by Miller Freeman, Washington D.C., September 16-19, 1998.