Chap 11 Old

download Chap 11 Old

of 84

Transcript of Chap 11 Old

  • 8/7/2019 Chap 11 Old

    1/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Chapter 11:

    Access Layer: Object Storage

    and Object Interoperability

    ObjectObject--Oriented SystemsOriented SystemsDevelopmentDevelopment:Using the Unified ModelingUsing the Unified Modeling

    LanguageLanguage

  • 8/7/2019 Chap 11 Old

    2/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Goals

    Object storage and persistence.

    Database management systems andtheir technology.

    Client-server computing.

    Distributed databases.Distributed object computing.

  • 8/7/2019 Chap 11 Old

    3/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Goals (Cont)

    Object-oriented database

    management systems.Object-relational systems.

    Designing access layer objects.

  • 8/7/2019 Chap 11 Old

    4/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Introduction

    A database management system(DBMS) is a collection of relateddata and associated programs thataccess, manipulate, protect andmanage data.

  • 8/7/2019 Chap 11 Old

    5/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Whats the purpose of DBMSThe main purpose of a DBMS is to

    provide a reliable, persistent data

    storage facility,and mechanism for efficient

    and convenient data access and

    retrieval.

  • 8/7/2019 Chap 11 Old

    6/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Persistence (review)Persistence is defined as objects

    that outlive the programs whichcreated them.

    Persistent object stores do notsupport query or interactive userinterface facilities, as found in afully supported DBMS orOODBMS.

  • 8/7/2019 Chap 11 Old

    7/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object Storage andPersistenceAtkinson et al. describe six broad

    categories for the lifetime of data:

    1. Transient results to the evaluation

    of expressions. 2. Variables involved in procedure

    activation (parameters and variables

    with a localized scope). 3. Global variables and variables

    that are dynamically allocated.

  • 8/7/2019 Chap 11 Old

    8/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object Storage andPersistence(Cont)

    4. Data that exist between the

    executions of a program. 5. Data that exist between the

    versions of a program.

    6. Data that outlive a program.

  • 8/7/2019 Chap 11 Old

    9/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Database Management Systems

    A DBMS is a set of programs thatenable the creation and maintenance

    of a collection of related data. DBMS have a number of properties

    that distinguish them from the file-

    based data management approach.

  • 8/7/2019 Chap 11 Old

    10/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Database system Vs. File System.

    Engineering

    Accounting

    Marketing

    Accounting

    Sal

    u t

    Em l

    I v t r

    u t m r Part

    Database

    DBMS

    Marketing

    Engineering Parts

    Customer

    Sales

    Inventory

    Accounts

    File System

    A Database System

  • 8/7/2019 Chap 11 Old

    11/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Database Models A database model is a collection of

    logical constructs used to represent the

    data structure and data relationshipswithin the database.

    Hierarchical Model

    Network Model

    Relational Model

  • 8/7/2019 Chap 11 Old

    12/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    H

    ierarchical model

    Motor Vehicle

    Truck CarBus

    The hierarchical model representsdata as a single-rooted tree.

  • 8/7/2019 Chap 11 Old

    13/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Network model

    Cust r up

    Ord r

    A network database model is similarto a hierarchical database, with onedistinction.

    Unlike the hierarchical model, anetwork model's record can have more

    than one parent.

  • 8/7/2019 Chap 11 Old

    14/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Relational Model

    Of all the database models, therelational model has the simplest,

    most uniform structure and is themost commercially widespread.

  • 8/7/2019 Chap 11 Old

    15/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Relational Database (Cont)

    Soup NSoup-I ric

    So p Table

    NCust-I ddr ss hone #

    C sto er Table

    Cust-ISoup-I QTY

    Order Table

    Order-IKey

    KeyKey

    Foreign

    Keys

  • 8/7/2019 Chap 11 Old

    16/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    What is a schema andmetadata? The schema, or metadata, contains a

    complete definition of the dataformats, such as the data structures,

    types, and constraints.

  • 8/7/2019 Chap 11 Old

    17/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Schema (Cont) In an object-oriented DBMS, the

    schema is the collection of class

    definitions.The relationships among classes

    (such as super/sub) are

    maintained as part of the schema.

  • 8/7/2019 Chap 11 Old

    18/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Database Definition Language

    (DDL)A database definition language

    (DDL) is used to describe thestructure of and relationshipsbetween objects stored in adatabase.

  • 8/7/2019 Chap 11 Old

    19/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Data Manipulation Language

    (DML)Once data is stored in a database,

    there must be a way to get it, use it,and manipulate it.

    DML is a language that allows users

    to access and manipulate (such as:creation, saving and destruction of)data organization.

  • 8/7/2019 Chap 11 Old

    20/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    DML (Cont)The Structured Query Language

    (SQL) is the standard DML forrelational DBMS.

    In a relational DBMS, the DML isindependent from a hostprogramming language.

  • 8/7/2019 Chap 11 Old

    21/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    DML (Cont)For example, a host language such as

    C or COBOL would be used to writethe body of the application.

    SQL statements are then typically

    embedded in C or COBOLapplications to manipulate data.

  • 8/7/2019 Chap 11 Old

    22/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    ShareabilityData in the database often needs

    to be accessed and shared bydifferent applications.

    The database then must detect andmediate the conflicts and promotethe greatest amount of sharing

    possible withoutsacrificing theintegrity of data.

  • 8/7/2019 Chap 11 Old

    23/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    TransactionAtransaction is a unit of change, in

    which either all changes to objectswithin a transaction will be applied

    or not at all.A transaction is said to commitif all

    changes can be successfully made to

    the database and to abortif allchanges cannot be successfullymade to the database.

  • 8/7/2019 Chap 11 Old

    24/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Concurrency Control

    Programs will attempt to read andwrite the same pieces of information

    simultaneously and, in doing so,create a contention for data.

    The concurrency

    control mechanism isthus established to

    mediate these conflicts.

  • 8/7/2019 Chap 11 Old

    25/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Concurrency Control (Cont) It does so by making policies that

    dictate how read and write conflictswill be handled.

  • 8/7/2019 Chap 11 Old

    26/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Concurrency Control (Cont)The most conservative way is to

    allow a user to lock all records or

    objects when they are accessedand to release the locks only aftera transaction commits.

  • 8/7/2019 Chap 11 Old

    27/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Concurrency Control (Cont)

    By distinguishing betweenreading the data, and writing it(which is achieved by qualifying thetype of lock placed in the data-readlock or write lock) somewhat greaterconcurrency can be achieved.

    This policy allows manyreaders of a record or anobjective, but only one writer.

  • 8/7/2019 Chap 11 Old

    28/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Distributed Databases In distributed databases portions of

    the database reside on differentnodes (computers) in the network.

  • 8/7/2019 Chap 11 Old

    29/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server ComputingClient/server computing allows

    objects to be executed in different

    memory spaces or even differentmachines.

  • 8/7/2019 Chap 11 Old

    30/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server Computing (Cont)

    The calling module becomes the"client" (which requests a service),and the called module becomesthe "server" (which provides theservice).

  • 8/7/2019 Chap 11 Old

    31/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server Computing (Cont)Client programs usually manage:

    The user-interface

    Validate data entered by the user

    Dispatch requests to server

    programs, and sometimesExecute business logic.

  • 8/7/2019 Chap 11 Old

    32/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server Computing (Cont)The Business layer contains all of

    the objects that represent thebusiness such as:

    Order

    Customer Line Item

    Inventory, etc.

  • 8/7/2019 Chap 11 Old

    33/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server Computing (Cont)A server process (program) fulfills

    the client request by performingthe task requested.

    Server programs generally receiverequests from client programs,execute database retrieval andupdates, manage dataintegrity, and dispatchresponses to client requests.

  • 8/7/2019 Chap 11 Old

    34/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Atwo-tierarchitecture is onewhere a client talks directly to aserver, with no intervening server.

    This type of architecture istypically used in smallenvironments with lessthan 50 users.

    ATwo-TierArchitecture

  • 8/7/2019 Chap 11 Old

    35/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    ATwo-TierArchitecture (Cont)

    SERVER

    APPLICATION

    CLIENTCLIENTCLIENT

    LAN WAN

    APPL. APPL. APPL.

    Printer

    Data

  • 8/7/2019 Chap 11 Old

    36/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    AThree-TierArchitectureA three-tier architecture

    introduces another server (or an"agent") between the client and

    the server.

    The role of the agent is many fold.

    I

    t can provide translation servicesas in adapting a legacy applicationon a mainframe to a client/serverenvironment.

  • 8/7/2019 Chap 11 Old

    37/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    AThree-TierArchitecture (Cont)

    UN X SERVER

    Host (i.e. IBM 3090)

    CLIENT

    Sy ase RDBMS

    Legacy a lications: DB2 RDBMS

    APPLICATION SWindo s 9x

    ACCES S

    Lotus

    Agent

  • 8/7/2019 Chap 11 Old

    38/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Basic Characteristics of

    Client/ServerArchitectures1. The client or front-end interacts

    with the user, and a server or back-end interacts with the sharedresource.

  • 8/7/2019 Chap 11 Old

    39/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Basic Characteristics of

    Client/ServerArchitectures (Cont)2. The front-end task and back-end

    task have fundamentally differentrequirements for computingresources.

    Resources such as processor speeds,memory, disk speeds and capacities,and input/output devices.

  • 8/7/2019 Chap 11 Old

    40/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    3. The environment is typicallyheterogeneous and multi-vendor.

    Basic Characteristics of

    Client/ServerArchitectures (Cont)

  • 8/7/2019 Chap 11 Old

    41/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Basic Characteristics of

    Client/ServerArchitectures (Cont)4. Client-server systems can be

    scaled horizontally or vertically.

    Horizontal scaling means adding orremoving client workstations withonly a slight performance impact.

    Vertical scaling means migrating toa larger and faster server machine ormulti servers.

  • 8/7/2019 Chap 11 Old

    42/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    DistributedProcessingDistributed processing implies that

    processing will occur on more thanone processor in order for a

    transaction to be completed.

    S e r v e r S e r v e r 1

    C l i e n t C l i e n t C l i e n t

    l i c t i n

    F r e n t 1

    l i c t i n

    F r e n t

  • 8/7/2019 Chap 11 Old

    43/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    DistributedProcessing (Cont)

    For example, in processing an orderfrom our client, the client

    information may process at onemachine and the accountinformation will then be processed

    next on a different machine.

  • 8/7/2019 Chap 11 Old

    44/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Cooperative processing

    Cooperative processing is a form ofdistributed computing where two ormore distinct processes are required

    to complete a single businesstransaction.

    C o o e ra t i e P r o c e s s in g

    A P P L I C A T I O N SW in d o s 9 x

    A C C E S S

    L otu s

    A P P L I C A T I O N S

    W in do s 9 xA C C E S S

    L otu s

    S E R V E R

  • 8/7/2019 Chap 11 Old

    45/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server Components

    I. User Interface Layer: This is one ofthe major components of theclient/server application.

    It interacts with users, screens,

    Windows, Window management,keyboard, and mouse handling.

  • 8/7/2019 Chap 11 Old

    46/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server Components (Cont)

    II. Business Processing Layer: This isa part of the application that usesthe user interface data to performbusiness tasks.

  • 8/7/2019 Chap 11 Old

    47/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Client/Server Components (Cont)

    III. Database Processing Layer: Thisis a part of the application code

    that manipulates data within theapplication.

  • 8/7/2019 Chap 11 Old

    48/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Distributed Object Computing (DOC)

    Distributed object computingpromises the most flexible

    client/server systems. It utilizes reusable software

    components that can roam anywhere

    on networks, run on differentplatforms, communicate with legacyapplications.

  • 8/7/2019 Chap 11 Old

    49/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    DOC (Cont)

    Currently, there are severalcompeting DOC standards,including:

    Microsoft's ActiveX/DCOM

    the Object Management Group'sCORBA, and

    OpenDoc.

  • 8/7/2019 Chap 11 Old

    50/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Common ObjectRequest Broker

    Architecture (CORBA)CORBA provides means to

    integrate distributed, heterogeneous

    business applications and data.The CORBAInterface Definition

    Language (IDL) allows developers to

    specify language-neutral, object-oriented interfaces for applicationand system components.

  • 8/7/2019 Chap 11 Old

    51/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    ObjectRequest Brokers (ORBs)

    ORBs implement a communicationchannel through which applications canaccess object interfaces and request data

    and services.

    Object Request roker (OR )

    DomainObjects

    NamingPersistenc

    eE ents

    oncurrency

    Transaction

    ApplicationObjects

  • 8/7/2019 Chap 11 Old

    52/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Microsoft's ActiveX/DCOM

    The Distributed Component Objectmodel, Microsoft's alternative toOMG's CORBA.

    DCOM is an Internet andcomponent strategy where ActiveX(formerly known as object linkingand embedding, or OLE) plays therole of DCOM object.

  • 8/7/2019 Chap 11 Old

    53/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object-Oriented Database Systems

    Database

    apabilities

    DataE

    apsulati

    P

    l

    mrphis

    m

    bject-

    rientedpr

    ramming

    Object

    Identit

    Object&

    lass

    Concurrenc

    y

    Security

    Recover

    y

    Quer

    y

    Integrity

    Versioning

    Archiv

    e

    Persistenc

    e

    Inheritanc

    e

    The object-orienteddatabase management

    system is a marriageof object-orientedprogramming anddatabase technology

    to provide what wenow call object-oriented databases.

  • 8/7/2019 Chap 11 Old

    54/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object-Oriented Database System

    ManifestoMalcolm Atkinson et al. described

    the necessary characteristics that a

    system must satisfy to be consideredan object-oriented database.

    These categories can be broadly

    divided into object-orientedlanguage properties anddatabase requirements.

  • 8/7/2019 Chap 11 Old

    55/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Manifesto (Cont)First, the rules that make it an object-oriented system are as follows:

    1. The system must support complex objects.

    2. Object identity must be supported.

    3. Objects must be encapsulated.

    4. The system must support types or classes.

    5. The system must support inheritance.

    6. The system must avoid prematurebinding.

    7. The system must be computationally

    complete.

  • 8/7/2019 Chap 11 Old

    56/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Manifesto (Cont) 8. The system must be extensible.

    Second, these rules make it a DBMS:

    9. It must be persistent, able to remember an

    object state. 10. It must be able to manage very large

    databases.

    11. It must accept concurrent users.

    12. It must be able to recover from hardwareand software failures.

    13. Data query must be simple.

  • 8/7/2019 Chap 11 Old

    57/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object-Oriented Databases versus

    Traditional DatabasesThe objects are an "active"

    component in an object-orienteddatabase.

    Relational database systems do notexplicitly provide inheritance ofattributes and methods.

  • 8/7/2019 Chap 11 Old

    58/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object-Oriented Databases versus

    Traditional Databases (Cont)Each object has its own identity, or

    object-ID (as opposed to the purelyvalue-oriented approach oftraditional databases).

    Object identity allows objects to berelated as well as shared within adistributed computing network.

  • 8/7/2019 Chap 11 Old

    59/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object-Relational Systems: The

    Practical World In practice, even though many

    applications increasingly aredeveloped in an object-orientedenvironment, chances are good thatthe data those applications need to

    access live in a very differentuniversea relational database.

  • 8/7/2019 Chap 11 Old

    60/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Object-Relation Mapping

    For a tool to be able to define howrelational data maps to and fromapplication objects, it must have at least

    the following mapping capabilities: Table-class mapping.

    Table-multiple classes mapping.

    Table-inherited classes mapping.

    Tables-inherited classes mapping.

  • 8/7/2019 Chap 11 Old

    61/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Table-Class Mapping

    Each row in the table represents an objectinstance and each column in the tablecorresponds to an object attribute.

    Car

    cost

    color

    ke

    model

    cost color make model

    Car Table

  • 8/7/2019 Chap 11 Old

    62/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Table-Multiple Classes Mapping

    The custID column provides the discriminant.If the value for custID is null, an Employeeinstance is created at run time; otherwise, aC stomerinstance is created. Employee

    name

    address

    empIname custIaddress

    Person Table

    empI

    C stomer

    name

    address

    custI

  • 8/7/2019 Chap 11 Old

    63/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Table-Inherited Classes Mapping

    Employee

    name

    ssn

    name address

    Person Table

    ssn

    Ho rlyEmployee

    wage

    SalariedEmployee

    address

    salar

    wage salar

    Instances of SalariedEmployee can be created for anyrow in the Person table that has a non null value forthe salary column. If salary is null, the row isrepresented by an Ho rlyEmployee instance.

  • 8/7/2019 Chap 11 Old

    64/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Tables-Inherited Classes Mapping

    name

    name address

    Person Table

    dept

    C

    stomer

    address

    company

    Employee

    Person

    name

    Employee Table

    ssn

    name address

    C stomer Table

    ssn

    ssn

    dept

    company

    salary

    salary

    Instances ofP

    erson aremapped directly from

    the Person table.

    Howe er, instances of

    Employee can be

    created only for the

    rows in the Employeetable (the joins of the

    Employee and Person

    tables on the ssn key).

    The ssn is sed both

    as a prim

    ary key on thePerson table and as a

    foreign key on the

    Person table and a

    primary key on the

    Employee table for

    acti ating instances of

  • 8/7/2019 Chap 11 Old

    65/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Keys forInstanceNavigation

    name

    Department able

    Department

    name

    Employee

    name

    Employee able

    ssnpartment ID salary

    salary

    epartment ID

    name

    ssn

    epartment ID

    The departmentID

    property of Employee

    uses the foreign key in

    column

    Employee.departmentID

    .Each Employee instance

    has a direct reference of

    class Department

    (association) to the

    department object to

    which it belongs.

  • 8/7/2019 Chap 11 Old

    66/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Multidatabase System

    A different approach for integratingobject-oriented applications withrelational data environments is

    multidatabase systems, orheterogeneous database systems,which facilitate the integration of

    heterogeneous databases and otherinformation sources.

  • 8/7/2019 Chap 11 Old

    67/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Federated Multidatabase SystemsFederated multidatabase systems

    provide a solution to the problem ofinteroperating heterogeneous data

    systems, provide uniform access todata stored in multiple databasesthat involve several different data

    models.

  • 8/7/2019 Chap 11 Old

    68/84

  • 8/7/2019 Chap 11 Old

    69/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Characteristics of MDBSAutomatic generation of a unifiedglobal database schema from localdatabases.

    Provision of cross-databasefunctionality (global queries, updates,and transactions) by using unified

    schemata. Integration of a heterogeneous database

    system with multiple databases.

  • 8/7/2019 Chap 11 Old

    70/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Characteristics of MDBS (Cont)

    Integration of data types other thanrelational data through the use of

    such tools as driver generators.Provision of a uniform but diverse

    set of interfaces (e.g., a SQL-style

    interface, browsing tools, and C++)to access and manipulate data storedin local databases.

  • 8/7/2019 Chap 11 Old

    71/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Open Database Connectivity

    Open database connectivity(ODBC), provides a mechanism forcreating a virtual DBMS.

    Applicationprograms

    ODBCdriver manager

    Database A

    Database B

    Database C

    Database D

    Database E

    oadableODBCdriver

    Driver fordatabaseA

    Driver fordatabaseB

    Driver fordatabaseC

    Driver forDatabaseD

    Driver fordatabase E

    ...

    ODBC

    API

  • 8/7/2019 Chap 11 Old

    72/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    DesigningAccess Layer Classes

    The main idea behind creating an accesslayer is to create a set of classes thatknow how to communicate with data

    source, whether it be a file, relationaldatabase, mainframe, Internet, DCOM,or via ORB.

    The access classes must be able totranslate any data-related requests from

    the business layer into the appropriate

    protocol for data access.

  • 8/7/2019 Chap 11 Old

    73/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Access Layer Classes (Cont)

    The business layerobjects and iew

    layer objects should

    not directly access

    the database.Instead, they

    should consult with

    the access layer for

    all external system

    connecti ity.

    Database, ORB, Internet, etc.

    View layer objects

    Business Layer Objects

    Access Layer Objects

    Application /

    Ser er

    ClientClientClient

    DBMS Seor

    Legacy dat

    applicatio

  • 8/7/2019 Chap 11 Old

    74/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Benefits ofAccess Layer ClassesA

    ccess layer classes provide easymigration to emerging distributedobject technology, such as CORBA andDCOM.

    These classes should be able toaddress the (relatively) modest needs

    of two-tier client/server architecturesas well as the difficult demands offine-grained, peer-to-peer distributed

    object architectures.

  • 8/7/2019 Chap 11 Old

    75/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Process

    The access layer design process consistsof these following activities:

    1.If methods will be stored in a program then

    For every business class identified, determine if the

    class has persistent data.

    else

    For every business class identified, mirror the

    business class package.

    2.Define relationships. The same rule as applies among

    business class objects also applies among access

    classes.

  • 8/7/2019 Chap 11 Old

    76/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Process (Cont)

    3.Simplify classes and relationships. The main goalhere is to eliminate redundant or unnecessary classes

    or structures.

    3.1.Redundant classes. If you have more than one

    class that provides similar services, simply select

    one and eliminate the other(s).

    3.2.Method classes. Revisit the classes that consist

    of only one or two methods to see if they can beeliminated or combined with existing classes.

    4. Iterate and refine.

  • 8/7/2019 Chap 11 Old

    77/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Process of CreatingAccess Layer

    ClassesBusiness

    Layer

    Access

    Layer

    Class1

    Class2 Class3

    Step1: irrorbusinessclasspackage

    Class1DB

    Class2DB Class3DB

    Access

    layer

    Class1DB

    Class2DB Class3DB

    Step2:Define relationships

    Access

    layer

    Access

    layer

    Class1

    Class2 Class3

    Class1DB

    Class2DB Class3DB

    Step3: Simplifyclassesand relationships

  • 8/7/2019 Chap 11 Old

    78/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Access Layer Classes (Cont)

    The relationbetween a

    business class andits associatedaccess class.

    Class1

    Class1DB

    Business class

    Access classfor Class1

  • 8/7/2019 Chap 11 Old

    79/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    SummaryT

    he fundamental purpose of aDBMS is to provide a reliablepersistent data storage facility and

    the mechanisms for efficient,convenient data access and retrieval.

    Many modern databases are

    distributed databases.

  • 8/7/2019 Chap 11 Old

    80/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Summary (Cont)Client/server computing is the logical

    extension of modular programming.

    Distributed computing is a second

    client/server revolution, a transitionto an immensely expandedclient/server era.

    The object-oriented databasetechnology is a marriage of object-

    oriented programming and database

    technology.

  • 8/7/2019 Chap 11 Old

    81/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Summary (Cont)

    In practice, e en though manyapplications increasingly are de eloped

    using object-oriented programming

    technology, the data those applicationsneed to access li e in a relational

    database.

  • 8/7/2019 Chap 11 Old

    82/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Summary (Cont)

    The main process in relational-object

    integration is defining the relationships

    between the table structures

    (represented as schemata) in the

    relational database with classes

    (representing classes) in the object

    model.

  • 8/7/2019 Chap 11 Old

    83/84

    Ob ect-Oriented S stems Develo ment Bahrami Irwin/ McGraw-Hill

    Summary (Cont)

    A different approach for integratingobject-oriented applications with

    relational data environmentsinvolves multidatabase systems, orheterogeneous database systems,

    which facilitate the integration ofheterogeneous databases and otherinformation sources.

  • 8/7/2019 Chap 11 Old

    84/84