250 likes | 359 Vues
This document examines Object-Oriented Database Management Systems (OODBMS), focusing on key concepts such as identity, inheritance, and data modeling using ODL and OQL. It highlights the distinctions between OODBMS and RDBMS/ORDBMS, discussing attributes, relationships, and methods essential in object-oriented design. Examples illustrate how OQL operates similarly to SQL, tailored for object databases. Additionally, the document explores the support for complex data types and programming languages, emphasizing the evolution of database management systems from traditional relational models to more advanced object-oriented frameworks.
E N D
Compare Extend New data OODBMS Object-Database Challenge Identity Inheritance Design
Object Class OQL OODBMS Data model ODL
ODMG Data Model • Đượctạobởi ODMG năm 1991. • Làmôhìnhchuẩnchocác CSDL đốitượng. • Địnhnghĩađốitượng qua ODL. • Truyvấnđốitượng qua OQL. • Hỗtrợnhiềukiểudữliệuvàhàmdựngkiểu. • Cơsởcho OODBMS.
Kháiniệm 1. Đốitượng (Object): cóđịnhdanh (OID) duynhất. 2. Lớp (Class): Mỗiđốitượnglàmộtthểhiệncủalớp. Vídụ: Collection of object OBJECT CLASS Unique oid Same properties
Kháiniệm 3. Thuộctính (Attribute): - Thuộctínhđơngiản. - Thuộctínhphứctạp. Vídụ:
Kháiniệm 4. Mốikếthợp (relationship): - Một – một: - Một – nhiều: - Nhiều – nhiều: - Cómộtquanhệnghịchtươngứng - inverse relationship. - Cótênmốikếthợpvàkiểudữliệu.
Kháiniệm 4. Mốikếthợp (relationship): Vídụ:
Kháiniệm 5. Phươngthức (method): - Làcáchoạtđộngcủacácđốitượng. - Khônggiốngvới stored procedure trongmôhìnhquanhệ - Cótênphươngthức, tênvàkiểucủamỗiđốisố, kiểucủagiátrịtrảvề.
Object Model vs Relation Model Object Model Relation Model ThemeGallery is a Design Content & Contents mall developed by Guild Design Inc. Similar Similar Similar Similar Similar Object TupleDigital Entity Class Attribute Attribute Relation Relation OID Primary key
Object Data Language – ODL • Hỗtrợcáckháiniệmngữnghĩacủa OODBMS. • Khôngphụthuộcvàobấtkỳngônngữlậptrìnhnào. • Dùngđểtạocácđặcđiểmcủađốitượng. • Khôngđượcdùngđểxửlý CSDL.
Vídụ showAt nowShowing
Vídụ Class Collection of Class interface Movie (extent Movies key movieName) { attributedate start; attributedate end;attributestringmovieName;relationship Set<Theater> shownAtinverse Theater::nowShowing; }
Vídụ interface Theater (extent Theaters key theaterName) { attributestringtheaterName; attributestring address; attribute integerticketPrice;relationshipSet<Movie> nowShowinginverse Movie:: shownAt; float numshowing() raises(errorCountingMovies); }
Vídụ interface SpecialShow extends Movie(extent SpecialShows){ attribute integer maximumAttendees; attribute stringbenefilCharity; }
Object Query Language - OQL • Làngônngữtruyvấncủa ODMG. • Làmviệcgiốngvớingônngữlậptrìnhnhư C++. • Cấutrúctươngtựnhư SQL vớicácđiểmđặctrưngcủađốitượng. • Cúpháp: SELECT – FROM - WHERE
Vídụ SELECTmname: M.movieName, tname: T.theaterName FROM Movies M, M.shownAt T WHERET.numshowing() > 1
Vídụ SELECTT.ticketPrice, avgNum: AVG(SELECTP.T.numshowing() FROM partition P) FROM Theaters T GROUP BYT.ticketPrice
Vídụ SELECT low, high, avgNum: AVG(SELECTP.T.numshowing() FROM partition P) FROM Theaters T GROUP BYlow: T.ticketPrice < 5, high:T.ticketPrice >= 5
Vídụ (SELECTT.theaterName FROM Theaters T ORDER BYT.ticketPrice DESC) [0:4]
Compare Extend New data ODL, OQL Object-Database Challenge Identity Inheritance Design
RDBMS versus ORDBMS • RDBMS khônghỗtrợphầnmởrộngcủa ORDBMS. • RDBMS dễsửdụnghơnvìnócóíttínhnănghơn. • RDBMS ítlinhhoạthơn ORDBMS.
OODBMS vs ORDBMSSimilarities • Hỗtrợcáckiểucócấutrúc, kiểuđốitượng, ADTS vàkếthừa. • Hỗtrợngônngữtruyvấnđểthaotáctrênkiểu collection: • ORDBMS: phầnmởrộngcủa SQL. • OODBMS: ODL/OQL. • ORDBMS thêmcáctínhnăngcủa OODBMS vào RDBMS. OODBMSpháttriểnngônngữtruyvấndựatrênngônngữtruyvấnquanhệ.
OODBMS vs ORDBMSDifferences • OODBMSthêmngônngữlậptrìnhvào DBMS, trongkhiORDBMSthêmcáckiểudữliệuphongphúvào RDBMS. • OODBMScómụctiêulàtíchhợpliềnmạchvớingônngữlậptrình, trongkhiđâykhôngphảilàmụctiêuquantrọngcủa ORDBMS.
OODBMS vs ORDBMSDifferences • OQL khôngđượchỗtrợhiệuquảtronghầuhết OODBMS, ngượclạichúnglàtrungtâmcủa ORDBMS. • OODBMS đãđượctốiưuhóađểhỗtrợchocácứngdụng HĐT vàcácngônngữ OO. ORDBMSs đượchỗtrợbởihầuhếtcác HQTCSDL hiện nay.