Download presentation
Presentation is loading. Please wait.
Published byBrenda Lane Modified over 9 years ago
1
My Research: Adding More Support for Relationships to DBMSs by Dr. Bryon K. Ehlmann Computer Science Department Southern Illinois University Edwardsville Edwardsville, IL 62026 USA behlman@siue.edu
2
Overview The problem of mapping relationships in database models into database definition languages (DDLs) –i.e., the problem in implementing associations (the majority of relationships) in DBMSs The Object Relationship Notation (ORN) Extending Data Models with ORN –ORN-extended UML Class Diagrams Extending Object Databases with ORN –Object Relater Plus and the ORN Simulator Extending Relational Databases with ORN –ORN Additive Conclusion –Questions –A two minute quiz
3
Problem of Mapping Database Models into DDLs ( 1-to-* Association) → SQL: Where is the “1” ? Where is the many ( “*”)?
4
Problem of Mapping Database Models into DDLs ( 1-to-1..* Association) → SQL:
5
Problem of Mapping Database Models into DDLs ( |~ Association) → Continued on Next Page… | ~ SQL:
6
Problem of Mapping Database Models into DDLs ( |~ Association) … Continued from Previous Page
7
Problem of Mapping Database Models into DDLs ( |~ Association) → | ~ ODMG ODL: class Department { d_String deptNum; … // other attributes relationship set employees inverse Employee::department; … // methods (must enforce association semantics) }; class Employee { d_String SSN; … // other attributes relationship Department department inverse Department::employees; … // methods (must enforce association semantics) };
8
Overview of the Object Relationship Notation (ORN) A declarative scheme for defining a variety of binary relationships, i.e. associations, between entities, i.e., classes Can be used during requirements analysis and database definition –Graphical representation integrated into modeling diagrams –Linear representation integrated into data definition languages like SQL Independent of database type, object or relational Extends UML multiplicities with bindings –Indicate what action system should take when update operations cause multiplicities to be violated –More powerful than the referential actions of SQL
9
Syntax of ORN
10
Semantics of ORN …
11
Extending Data Models with ORN Example of an ORN-Extended UML Class Diagram Semantics for |~ binding for “belongs to” association: On delete of an employee object, an employee carpool link can be destroyed, but if this violates the multiplicity 2..*, the related carpool object must be implicitly deleted
12
If an employee carpool link is destroyed, the related carpool object is implicitly deleted if there are just two employees in a carpool ( X~ binding). If an employee is deleted, the link to the employee’s organization is implicitly destroyed (default binding and * multiplicity). If an organization is deleted, all descendant organizations are implicitly deleted. Any descendant organization, however, will not be deleted in this complex operation if it has any employees ( ' binding and default binding with 1 multiplicity for Organization in “works for” association). If a link between organizations is destroyed, the child organization and all its descendant organizations are implicitly deleted; however, again, an organization is not deleted if it has any employees ( ' binding and default binding with 1 multiplicity for Organization in “works for” association). Additional Association Semantics Captured in Previous Model
13
Extending Object Databases with ORN Example of an ORN-extended ODDL (ODMG 3.0 ODL)
14
Object Relater Plus (OR+) and the ORN Simulator OR+ is a prototype, object DBMS that implements ORN –Built on top of Object Store, a commercial ODBMS –Implemented on Unix using C++ –Provides an ORN-extended, ODMG 3.0 standard façade to Object Store ORN Simulator is a prototype, Web-accessible database modeling tool built using OR+ –an OR+ application –Server implemented on Unix using C++ –Client implemented as an applet using Java –Accessible at www.siue.edu/~behlmanwww.siue.edu/~behlman –“Simulates” the modeled database by allowing the user to create and update a prototype database in the context of an ER or UML class diagram – Provides a instructional tool for learning database modeling, ORN, and transaction processing
15
Extending Relational Databases with ORN Example of an ORN-Extended UML Class Diagram
16
Extending Relational Databases with ORN Example of an ORN-extended, standard SQL CREATE TYPE ORG_TYPE AS ( IDCHAR(5), PARENTREF(ORG_TYPE), ); CREATE TABLE ORGANIZATION OF ORG_TYPE ( REF IS ORG_REF SYSTEM GENERATED, PARENT WITH OPTIONS SCOPE ORGANIZATION ’... ); CREATE TABLE EMPLOYEE ( SSNCHAR(11) PRIMARY KEY,... CARPOOL_ID CHAR(8) REFERENCES CARPOOL |~X~ ON UPDATE CASCADE, ORGREF(ORG_TYPE) SCOPE(ORGANIZATION) ); CREATE TABLE CARPOOL ( IDCHAR(8) PRIMARY KEY,... );
17
ORN Additive A (prototype?) tool that essentially adds ORN to Microsoft’s SQL Server –Currently being developed on Windows platform using Visual C++ and Transact SQL –Consists of a DDL Utility postprocessor to allow s to be given for foreign key constraints Generates triggers and stored procedures to enforce ORN –Consists of a DML Utility preprocessor to allow for ORN- required transaction processing (e.g., checks on lowerbound multiplicities at transaction commit)
18
T-SQL w/ ORN Additive (Database Definition) CREATE TABLE Employee ( ssnCHAR(11) PRIMARY KEY,... carpoolId VARCHAR(8) CONSTRAINT BelongsTo REFERENCES Carpool(id), --+<> BelongsTo |~X~ ; -- Upperbound added orgVARCHAR(15) CONSTRAINT WorksFor REFERENCES Organization(name), --+<> WorksFor ; ); CREATE TABLE Carpool ( idVARCHAR(8) PRIMARY KEY,... ); CREATE TABLE Organization ( nameVARCHAR(15) PRIMARY KEY, parent VARCHAR(15) CONSTRAINT ChildParent REFERENCES Organization(name), --+<> ChildParent ' ON UPDATE CASCADE;... );
19
T-SQL w/ ORN Additive (Database Manipulation) -- Contents of the ORN header file for the CompanyDB must be included -- here. USE CompanyDB; DELETE Employee WHERE ssn = '555-55-5555'; -- May result in the deletion of a row in Carpool. UPDATE Employee SET carpoolId = ′West End′ WHERE ssn = ′123-45-6789′; -- Will result in an exception if six employees already belong to -- the West End carpool. DELETE Organization WHERE name = ′DP Services′; -- May result in the deletion of a hierarchy of employeeless -- organizations. GO
20
Questions?
21
Conclusion: Two Minute Quiz 1. Dr. Ehlmann’s research deals with enhancing DBMSs to better support a) security b) objects c) relationships d) queries e) video and sound 2. The following notation includes multiplicities and bindings that define the semantics of associations. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL 3. The following prototype implements an extended object DBMS on Unix and is built on top of Object Store. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL 4. The following prototype provides enhanced database modeling and allows a prototype database to be created and updated in the context of the model. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL 5.The following tool will enhance Microsoft’s SQL Server and is being developed using Visual C++. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL
22
Conclusion: Answers to Two Minute Quiz 1. Dr. Ehlmann’s research deals with enhancing DBMSs to better support a) security b) objects c) relationships d) queries e) video and sound 2. The following notation includes multiplicities and bindings that define the semantics of associations. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL 3. The following prototype implements an extended object DBMS on Unix and is built on top of Object Store. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL 4. The following prototype provides enhanced database modeling and allows a prototype database to be created and updated in the context of the model. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL 5.The following tool will enhance Microsoft’s SQL Server and is being developed using Visual C++. a) OR+ b) ORN c) ORN Additive d) ORN Simulator e) ODDL
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.