Download Access layer - WordPress.com

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Access wikipedia , lookup

Concurrency control wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
Access layer
Object storage and object
interoperability
• Database management system is a set of
programs that enables the creation and
maintenance of the related data.
• The fundamental purpose of DBMS is to
provide a reliable, persistent data storage
facility and the mechanisms for efficient,
convenient data access and retrieval.
Difference between DBMS and file
system
• File:
– Each application defines and implements the files it
requires.
– Meta data is encapsulated.
• DBMS:
– A single repository of data is maintained which can be
defined once and accessed by various users.
– It contains full description of data (schema or
metadata) along with data.
– Format of metadata is independent of any application.
Database views
• Physical view : how data are stored
• Logical view: what data are stored. It uses
logical concepts such as fields, records and
tables and their relationships.
1. Database models
• It is the collection of logical constructs used to
represent the data structures and data
relationships within the database.
• Two categories:
– Conceptual models: focuses on logical nature of
the data. What is represented in the data
– Implementation models: concerned with how it is
represented.
1.1 hierarchical models
• It represents data as a single rooted tree.
• Each node represents a data object and
connections represent parent-child
relationship
• It represents super-sub relationship of objects.
Motor vehicle
Bus
Truck
Car
1.2 network model
• A network model record can have more than
one parent.
Customer
Soup
Order
1.3 relational model
• Its like tables
• The columns are attributes that defines the data or
value entry for that column.
• The rows are tuples, represents individual data values.
• Primary key:
– Single value
– Combination of one or more attributes whose value
identifies the entry in the table.
• Foreign key:
– Primary key of one table that is embedded in another table
to link them.
2. Data base interfaces
• Database schema and data definition
language:
– It is used to specify structure and relationship
between the objects.
– The structure is called database schema.
– Ex: create schema authorization (Creator)
create database database name
create table tablename (name char (10) not null, dob
varchar (10));
• Data manipulation language and query
capabilities:
– It allows user to manipulate and access the data
objects.
– SQL is the standard DML.
3. Object relation mapping
3.1 table-class mapping
• It is a simple one-to-one mapping of a table to
a class.
• The column of the table is mapped to
attributes of class.
• Single table is mapped to a single class.
Cost
Color
Make
model
Car
Cost
Color
Model
make
3.2 table-multiple classes mapping
• Single table is mapped to multiple non
inheriting classes.
• Two or more distinct classes have properties
that are mapped to columns in a single table.
• At run time a mapped table row is accessed as
an instance of one of the classes based on the
column value.
Ex: table multiple classes mapping
Name
Address
cusID empID
Employee
Name
Address
empID
Customer
Name
Address
CusID
3.4 Table-inherited classes mapping
• A single tables maps to many classes that have
common super class.
• This allows the user to specify the columns to
be shared among the related classes.
Ex:
Name
Address Ssn
Wage
salary
Employee
Name
Ssn
address
hourlyEmployee
salariedEmployee
wage
salary
3.5 Tables-inherited classes mapping
• Translation of is-a relationship.
• In a relational database is-a relationship is
modeled by a primary key that acts as a
foreign key to another table.
Multi database systems
• Approach for integrating object oriented
application with relational data environment.
• Heterogeneous information system allow to
integrate heterogeneous information sources.
– Can be structured, semi structured or un structured.
• Can be constructed over global schema of several
databases.
• So user can access data stored in different
databases .
• This is referred to as federated multi database
systems.
• Multi database systems (MDBS) is a database
systems that resides on top of all local
database systems and presents a single
database illusion to its users.
• It maintains the global schema which is the
integration of all local databases.
• The schematic differences are handled by
neutralization, the process of consolidating
local schema.
Multidatabase
OODBMS
DBMS
ORDBMS
Virtual database
Application
• MDBS translates global queries and updates to
the appropriate local database for actual
processing.
• Merge the results from the local databases
and generate the consolidated result for the
user.
• It coordinates the committing and aborting of
global transactions by the local databases.
• Characteristics of MDBS:
– Automatic generation of a unified global database
schema from local databases.
– Provision of cross-database functionality by using
unified schemata.
– Integration of heterogeneous database systems
with multiple databases.
– Integration of data types
– Provision of uniform but diverse set of interfaces
to access and manipulate local data.
Open Data Base Connectivity
• ODBC is an application programming interface
that provides solutions to the multi database
programming.
• ODBC and other APIs provide standard
database access through a common clientside interface.
Designing access layer classes
• Creating access layer is to create a set of classes
that know hoe to communicate with the places
where the actual data resides.
• The access layer must be able to translate the
data request from the business layer into
protocol for data access.
• Also retrieved data into the business layer format.
• In three tier architecture,
– The view layer : client
– Business layer: application server
– Access layer: data base
• Two major tasks:
– Translate the request: able to translate the data
request from the business layer into protocol for
data access.
– Translate the result: Also retrieved data into the
business layer format
process
1. Mirror the business class package. For every identified
business class, create one access class in access layer
package.
2. Define relationship. The same rule among business classes
applies to access classes.
3. Simplify classes and relationships. Eliminate unnecessary
and redundant classes. Also combine simple classes and
simplify super-sub class structure.
3.1 redundant classes: select only one class if more than one
classes provides same service.
3.2 method classes: revisit the classes that consists of only one or
two methods , if they can be eliminated or combined.
4. Iterate and refine