• Sonuç bulunamadı

MASTER THESIS

N/A
N/A
Protected

Academic year: 2021

Share "MASTER THESIS"

Copied!
25
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

Department of Computer Engineering

MASTER THESIS

OBJECT DATA MODELING AS STRUCTURING APPROACH IN DATABASE DESIGN

Name : Anwar Mahmoud Dawoud

Supervisor : Assist. Prof. Dr. Adil Amirjanov

(2)

• One of the approach for simplification of the database design is to use object modeling of data .

• In this thesis the object data modeling is used as structuring approach for database design.

• The concept of the Object Relational DB System (ORDBS) as a hybrid of the RDBS and OODBS.

• The ORDBMS provide Object Definition Language(ODL), and a Object Query Language(OQL).

Introduction

(3)

Objects

Object-oriented programming.

A Database system.

Object Relational Databases.

Object-Oriented Databases.

Object Data Modeling

Some Basic Concepts :

(4)

Simplified Picture Of A Database System

Database

Database Management System (DBMS)

Application

programs End Users

(5)

Database Capabilities Concurrency Transactions

Recovery Query

Security Integrity

Persistence

Object Oriented Modeling Complex objects Attributes

Classes Object identity

Overriding Encapsulation

Behaviors

Inheritance Naming

Makeup of an Object Oriented Database

An Object Oriented Database is the marriage of Object Oriented modeling and Database Technology

(6)

Basic Object Oriented Modeling

1. Complex Objects 2. Object Identity

3. Classes and Types.

4. Attributes 5. Behaviors

6. Encapsulation 7. Inheritance.

8. Overloading, Overriding, and Late Binding 9. Naming

(7)

Client Server Architectures

a) object server )

Objects Store

) b) page server

) c) database server

Objects Store Application Object Manager Requests Object Server

Objects

Objects Store

DB Manager Object Server

Addresses Pages

Application Comms SQL Object Server

Tables Application

(8)

Strategies For Handling Method

) b) Storing method in database .

Objects Store Application Object Manager Requests

Objects

File 1

Objects Store Application Object Manager

Object Server

Object Server Request

Objects File 2 File 3

) a) Storing method outside database

(9)

Database Capabilities

1. Integrity

1.1 Relationships Integrity 1.2 Nulls Integrity

1.3 Referential Integrity 1.4 Entity integrity

2. Concurrency Control 3. Recovery

4. Transactions 5. Security

(10)

Classification of DBMSs

Data Complexity Extensibility Relational DBMS

File Systems

Object-Relational DBMS

Object-Oriented DBMS

Search Capabilities multi-user Support

(11)

The object features proposed in SQL3 covering:

• Row types.

• User-defined types (distinct types and structured types)

• User-defined Routines (procedure, functions).

• Polymorphism.

• Supertype and subtype relationships.

• Persistent stored modules.

• Support for large objects.

Classification of DBMSs

(12)

Object Relational Algebra

Union Intersection Difference

a b c

x y

a a b b c c

x y x y x y

Product

(13)

Object Relational Algebra

Project Restrict

a1 a2 a3

b1 b1 b2

a1 a2 a3

b1 b1 b2

a1 a2 a3

b1 b1 b2

a1 a2 a3

(Normal) Join

a b c

x z a

a a b c

x y z x y

Divide

a

(14)

Object Relational SQL

These SQL statements define the structure of a database, DDL SQL statements are more part of the DBMS and have large differences between the SQL variations. CREATE;

ALTER, DROP are called DDL COMMANDS.

1- DDL (Data Definition Language)

DDL transact with tables, views, types, procedures, functions and triggers.

(15)

Object Relational SQL

These SQL statements are used to retrieve and manipulate data.

2- DML (Data Manipulation Language)

DML SQL commands include the following:

INSERT to add a row.

UPDATE to change data in specified columns.

DELETE to remove rows.

SELECT to retrieve row.

(16)

Emp_no Emp_name Emp_birth Nationality_id

Emp_id Position_id Department_id

Emp_sex Emp_marital_stat

us Emp_phone Emp_Email Emp_address

Nationality_id Nationality_name

Position_id Position_name

Department_id Department_name PK

PK

PK FK

FK FK EMPLOYEE

NATIONALITY

POSITION

DEPARTMENT

Database Design With Object Data Modeling

Cus_no Good_serial Good_name Good_price Good_sale_date

GOODS

Cus_no Cus _name

Cus_birth Cus_id Cus_sex Cus_phone Cus_Email Cus_address CUSTOMER PK

FK

(17)

New Data Types

Birth_ty

Phone_ty

Address_ty Name_ty

New Data Types

Fname Mname

Lname

Mobile Home DOB

POB

City Street

(18)

New DataType that used in Employee & Customer Tables

New Data Types

Birth_ty

Phone_ty

Address_ty Name_ty

Emp_no Emp_name

Emp_birth Nationality_id

Emp_id Position_id Department_id

Emp_sex Emp_martial_status

Emp_phone Emp_Email Cus_no

Cus _name Cus_birth

Cus_id Cus_sex Cus_phone Cus_Email Cus_address

(19)

Create Table Customer ) Cus_No

Number)9)Primary Key,

Fname Varchar2)25),

Mname Varchar2)25),

Lname Varchar2)25),

DOB Date,

POB Varchar2)25),

Cus_Id

Number)9), Cus_Sex

Number)1),

Mobile Varchar2)13),

Home Varchar2)13),

Cus_Email Varchar2)25),

The Object Definition Language ) ODL )

Create table without using objects

Create Table Customer ) Cus_No

Number)9)Primary key, Cus_Name

Name_Ty,

Cus_Birth

Birth_Ty,

Cus_Id

Number)9),

Cus_Sex

Number)1),

Cus_Phone

Phone_Ty,

Cus_Email Varchar2)25),

Create table with Using objects )new defined types)

(20)

The Customer Table Before And After Using Objects

Cus_name

Cus_birth

Cus_phone

Cus_address Cus_no

Fname Mname

Lname DOB POB Cus_id Cus_sex

Phone Home Cus_Email City

Cus_no Cus _name

Cus_birth Cus_id Cus_sex Cus_phone Cus_Email Cus_address

CUSTOMER BEFORE

USING OBJECTS

CUSTOMER AFTER

USING OBJECTS

(21)

The Object Definition Language ) ODL )

Create Or Replace View Employee_Vw As Select E.Emp_No,

E.Emp_Name, E.Emp_Birth,

N.Nationality_Name, P.Position_Name, D.Department_Name

From Employee E , Nationality N , Position P , Department D

Where N.Nationality_Id =

E.Nationality_Id And

P.Position_Id = E.Position_Id And D.Department_Id = E.Department_Id;

Create view without using objects Create view with Using objects )new defined types)

Create Or Replace View Employee_Vw As Select E.Emp_No,

E.Fname, E.Mname, E.Lname, E.DOB E.POB

N.Nationality_Name, P.Position_Name, D.Department_Name

From Employee E , Nationality N , Position P , Department D

Where N.Nationality_Id = E.Nationality_Id And P.Position_Id = E.Position_Id And

(22)

Create Or Replace Procedure New_Employee

) Employee_No In Number,

Employee_Fname In Varchar2, Employee_Mname In Varchar2, Employee_Lname In Varchar2, Employee_Dob In Date,

Employee_Pob In Varchar2 )

As Begin

Insert Into Employee)Emp_No,Fname,Mname, Lname, Dob, Pob)

Values) Employee_No,Employee_Fname, Employee_Mname, Employee_Lname, Employee_Dob ,Employee_Pob);

Create Or Replace Procedure New_Employee ) Employee_No In Number,

Employee_Name In Name_Ty,

Employee_Birth In Birth_Ty ) As

Begin

Insert Into

Employee)Emp_No,Emp_Name,Emp_Birth)

Values)Employee_No,Employee_Name,Employee_Birt h);

End;

The Object Definition Language ) ODL )

Create procedure without using objects Create procedure with Using objects )new defined types)

(23)

Insert Into Employee ) Emp_No, Fname, Mname, Lname, Dob , Pob )

Values

) 20043315,

'Anwar', 'M', 'Dawoud', '12-Nov-82', 'Palistine' );

.

Insert Into Employee) Emp_No, Emp_Name , Emp_Birth )

Values ) 20043315,

Name_Ty)'Anwar','M','Dawoud'), Birth_Ty)'12-Nov-82','Palistine') );

The Object Query Language ) OQL )

Update Employee

Set Emp_Name=Name_Ty)'Ahmed','A','Dalo') Where Emp_No=20043815;

Update Employee

Set Fname='Ahmed', Mname='A', Lname='Dalo' Where Emp_No=20043815;

Insert Statement Without Using Objects Insert Statement With Using Objects

Update Statement Without Using Objects Update Statement With Using Objects

(24)

Delete From Employee

Where Emp_Name=Name_Ty)'Ahmed', 'R', 'Dawoud');

Select Emp_No, Emp_Name From Employee;

The Object Query Language ) OQL )

Delete From Employee

Where Fname='Ahmed' And

Mname='R' And Lname='Dawoud';

Select E.Emp_No, E.Fname, E.Mname, E.Lname From Employee E;

Delete Statement Without Using Objects Delete Statement With Using Objects

Select Statement Without Using Objects Select Statement With Using Objects

(25)

The thesis analyzes the features of Object Structured Query Language (OSQL) that includes Object Data Definition Language and Object Query Language. This analysis with discussion of the advantages of OSQL was made by structuring the problem with object data modeling in Trading

Company Database Design .

The comparisons of the SQL statements made with and without object features showed that the implementing object data modeling approach in

database design gets the following advantages :

• Simplify the design by reduction of the steps of abstractions for mapping the real life problem to the database structure design;

• Simplify the structuring of problem by using object data modeling

• Reduce the number of SQL statements in query descriptions;

Conclusion

Referanslar

Benzer Belgeler

In a situation where CEMIII is to be used for water resisting structure, addition of any admixture will not be essential because the permeability value at 28th day is at the least

In this research work, pure silk fibroin synthesized from cocoons of B.mori silkworm is loaded with two antimicrobial drugs in different ratios using

In Section 3.1 the SIR model with delay is constructed, then equilibrium points, basic reproduction number and stability analysis are given for this model.. In Section

The developed system is Graphical User Interface ( MENU type), where a user can load new speech signals to the database, select and play a speech signal, display

This thesis describes the steps of transforming and implementation of object- oriented techniques to the database software that is now implemented as Object- Relational

The first chapter shows some basic concepts related with this thesis such as Object-oriented programming, objects, database system, and object-oriented database.. Also it explains

Object-Oriented Database Systems are based on Object-Oriented Programming Language and Database storage mechanisms that depend on the data model established.. The Relational

[2] Cattell, R.G.G., Object Data Management: Object-Oriented and Extended Relational Database Systems.. J DATE An Introduction to Database System – 7 th ed, Addison