ObjectOriented Analysis - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

ObjectOriented Analysis

Description:

Databases are integrated collections of stored data that are centrally managed and controlled ... Schema designer can create new data types and associated constraints ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 31
Provided by: thebankno
Category:

less

Transcript and Presenter's Notes

Title: ObjectOriented Analysis


1
Object-OrientedAnalysis Design
  • Session 6

2
Databases and DBMSs
  • Databases are integrated collections of stored
    data that are centrally managed and controlled
  • Described by a schema
  • DBMSs are system software components that manage
    and control access to a database

3
Components of a DB and DBMS
4
DBMS Important capabilities
  • Simultaneous access by multiple users and
    applications
  • Access to data without application programs
  • Managing organizational data

5
Database Models
  • Impacted by technology changes
  • Model Types
  • Hierarchical
  • Network
  • Relational
  • Object-oriented
  • Current systems generally use relational or
    object-oriented data models

6
Relational Databases
  • The relational database management system
    organizes data into tables or relations
  • Tables
  • Tuples rows or records
  • Fields columns or attributes
  • Tables have key field(s) which can be used to
    identify unique records
  • Keys relate tables to each other

7
Entity Relationship Diagram
8
Partial Relational Database Table
9
Designing Relational Databases
  • Create table for each entity type
  • Choose or invent primary key for each table
  • Add foreign keys to represent one-to-many
    relationships
  • Create new tables to represent many-to-many
    relationships
  • Define referential integrity constraints
  • Evaluate schema quality and make necessary
    improvements
  • Choose appropriate data types and value
    restrictions (if necessary) for each field

10
Enforcing Referential Integrity
  • Consistent relational database state
  • Every foreign key also exists as a primary key
    value
  • DBMS enforces referential integrity automatically
    once schema designer identifies primary and
    foreign keys

11
Automatic Enforcement for Referential Integrity
  • When rows containing foreign keys are created,
    DBMS ensures that the value also exists as a
    primary key in related table
  • When row is deleted, DBMS ensures no foreign key
    in related tables have the same value as primary
    key of deleted row
  • When primary key value is changed, DBMS ensures
    no foreign key values in related tables contain
    the same value

12
Evaluating Schema Quality
  • High quality features
  • Uniqueness of table rows and primary keys
  • Ease of implementing future data model changes
    (flexibility and maintainability)
  • Lack of redundant data
  • Is Design judgment-based?

13
Database Normalization
  • Ensure database quality by minimizing data
    redundancy
  • Normal forms
  • 1NF - no repeating fields or groups of fields
  • Functional dependency - one-to-one relationship
    between the values of two fields
  • 2NF - in 1NF and if each non-key element is
    functionally dependent on entire primary key
  • 3NF - in 2NF and if no non-key element is
    functionally dependent on any other non-key
    element

14
Decomposition of 1NF Table into 2NF Tables
15
Conversion of 2NF Table into 3NF Tables
16
Object-Oriented Databases
  • Direct extension of the OO design and programming
    paradigm
  • ODBMS stores data as objects or classes
  • Object definition language (ODL)
  • Standard language for describing structure and
    content of an object database

17
Designing Object Databases
  • Determine which classes require persistent
    storage
  • Define persistent classes
  • Represent relationships among persistent classes
  • Choose appropriate data types and value
    restrictions (if necessary) for each field.

18
Representing Classes
  • Transient
  • Exist only during lifetime of program or process
  • Examples view window, pop-up menu
  • Persistent
  • Not destroyed when program or process ceases
    execution
  • Exist independently of program
  • Examples customer information, employee
    information

19
Representing Relationships
  • Object identifiers
  • Used to identify objects uniquely
  • Physical storage address or reference
  • Relate objects of one class to another
  • ODBMS uses attributes containing object
    identifiers to find objects that are related to
    other objects

20
Representing Relationships (cont.)
  • Keyword relationship can be used to declare
    relationships between classes
  • Advantages include
  • ODBMS assumes responsibility for determining
    connection
  • ODBMS assumes responsibility for maintaining
    referential integrity
  • Type of relationships
  • 11, 1M, MM
  • Association class used with MM

21
11 Relationship Represented with Attributes
Containing Object Identifiers
attributes shown in color
22
1M Relationship Between Customer and Order
Classes
23
1M with Attributes Containing Object Identifiers
24
MM Relationship between Employee and Project
Classes
25
MM Relationship Represented with two 1M
Relationships
26
Generalization Hierarchy
27
Hybrid Object-Relational Database Design
  • Relational database management system used to
    store object attributes and relationships
  • Two design tasks
  • Developing complete relational schema
  • Developing equivalent set of classes
  • Problems
  • Programmer defined method storage and execution
  • Relationships are restricted
  • ERDs cannot represent methods

28
Relationships and Inheritance in Hybrid Design
  • Relationships must be represented with foreign
    keys
  • Inheritance
  • Combine all tables into a single table containing
    a superset of all class attributes but excluding
    all invented fields from child classes
  • Use separate tables to represent child classes
    and substitute the primary key of the parent for
    the invented keys of the child

29
Data Types
  • Storage format and allowable content of a program
    variable
  • Primitive data types
  • Pointer, Boolean, integer, etc.
  • Complex data types
  • Dates, times, audio streams, video images
  • User-Defined data types

30
Object DBMS Data Types
  • Comparable to RDBMS data types
  • Schema designer can create new data types and
    associated constraints
  • Classes are complex user-defined data types that
    contain methods to manipulate data
Write a Comment
User Comments (0)
About PowerShow.com