Credit where Credit is Due. Last Lecture. Goals for this Lecture

Similar documents
Credit where Credit is Due. Goals for this Lecture. Introduction to Design

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

Chapter 11 Object and Object- Relational Databases

Lecture 2: Software Engineering (a review)

Topics. Persistent database layer. (c) Addison Wesley Chapter 8 3. Chapter 8 Database Design. MACIASZEK (2001): Req Analysis & Syst Design 1

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Data models. Topics. Application model & persistent model. Persistent database layer. Mapping objects to database. (c) Addison Wesley Chapter 8

Systems Analysis and Design in a Changing World, Fourth Edition. Chapter 12: Designing Databases

Chapter 12 Object and Object Relational Databases

Conceptual Design. The Entity-Relationship (ER) Model

Database Design Process

Unit 2. Unit 3. Unit 4

CS352 Lecture - Data Models

Outline. CUGS Core - Databases. Requirements. Work method. Databanks/Databases. Databank

M S Ramaiah Institute of Technology Department of Computer Science And Engineering

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical

ITCS Jing Yang 2010 Fall. Class 16: Object and Object- Relational Databases (ch.11) References


Introduction to modeling

8) A top-to-bottom relationship among the items in a database is established by a

Data, Databases, and DBMSs

Review The Big Picture

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1

THE COPPERBELT UNIVERSITY

Database Design Process. Requirements Collection & Analysis

Unified Modeling Language (UML)

High-Level Database Models (ii)

CS352 Lecture - Data Models

Chapter 8 Persistence and Database Design

Essay Question: Explain 4 different means by which constrains are represented in the Conceptual Data Model (CDM).

Class Information. Textbooks. Grading. Final Project. Grading. CS 440: Database Management Systems. Instructor:

Teaching Scheme BIT/MMC/BCS Database Systems 1

Topics. About persistence and databases. Levels of data models. 1. Business objects and persistence. Pearson Education 2007 Chapter 8 (RASD 3/e)

Object-Oriented Design

Entity-Relationship Models: Good Design and Constraints

MTAT Introduction to Databases

Constructs in Oracle

Topics. Designing the program. Chapter 9 Program and Transaction Design. (c) Addison Wesley Chapter 9

; Spring 2008 Prof. Sang-goo Lee (14:30pm: Mon & Wed: Room ) ADVANCED DATABASES

Lecture 2: Entity Relationship Data Model 2. 1

ALLAMA IQBAL OPEN UNIVERSITY, ISLAMABAD (Department of Computer Science)

E-R Diagram to Relational Schema

Relational Database Components

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

Ch. 21: Object Oriented Databases

Chapter 8 Persistence and Database Design

The Entity Relationship Model

Credit where Credit is Due. Lecture 25: Refactoring. Goals for this lecture. Last Lecture

Where Are We? Next Few Lectures. Integrity Constraints Motivation. Constraints in E/R Diagrams. Keys in E/R Diagrams

Handout 4. Logical Database Modeling, Part 1: Relational Data Model. Transforming EER model to Relational.

Object Database Standards, Languages, and Design

CSE 3241: Database Systems I Databases Introduction (Ch. 1-2) Jeremy Morris

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model.

2. An implementation-ready data model needn't necessarily contain enforceable rules to guarantee the integrity of the data.

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement

Lecture Notes UML UNIT-II. Subject: OOAD Semester: 8TH Course No: CSE-802

Tutorial notes on. Object relational structural patterns

15CS53: DATABASE MANAGEMENT SYSTEM

Data Modelling and Databases. Exercise Session 7: Integrity Constraints

Introduction to Information Systems

Specific Objectives Contents Teaching Hours 4 the basic concepts 1.1 Concepts of Relational Databases

Data about data is database Select correct option: True False Partially True None of the Above

Object-Oriented Analysis and Design Using UML (OO-226)

Introduction to Databases

High Level Database Models

CHAPTER 2: DATA MODELS

DATABASE DEVELOPMENT (H4)

CHAPTER 2: DATA MODELS

LAB 2 Notes. Conceptual Design ER. Logical DB Design (relational) Schema Refinement. Physical DD

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

A Sample Solution to the Midterm Test

Informatics 1: Data & Analysis

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015

Course Book Academic Year

Data Warehouse and Data Mining

Information Systems (Informationssysteme)

Chapter 1 SQL and Data

3. Object-Oriented Databases

Conceptual Design with ER Model

B.C.A DATA BASE MANAGEMENT SYSTEM MODULE SPECIFICATION SHEET. Course Outline

ENHANCING DATA MODELS WITH TUNING TRANSFORMATIONS

DATABASE MANAGEMENT SYSTEMS

CPSC 421 Database Management Systems. Lecture 19: Physical Database Design Concurrency Control and Recovery

CSIT5300: Advanced Database Systems

Introduction. Example Databases

Overview. Data Integrity. Three basic types of data integrity. Integrity implementation and enforcement. Database constraints Transaction Trigger

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Lecture 2 and 3: Fundamental Object-Oriented Concepts Kenneth M. Anderson

Last Lecture. Lecture 26: Design Patterns (part 2) State. Goals of Lecture. Design Patterns

Informatics 1: Data & Analysis

ER to Relational Model. Professor Jessica Lin

Topics. Levels of data models. About persistence and databases. Relational database model. Pearson Education 2005 Chapter 8 (Maciaszek - RASD 2/e) 6

Introduction to Data Management. Lecture #4 (E-R à Relational Design)

Module 2 : Entity-Relationship Model 15

CMP-3440 Database Systems

A l Ain University Of Science and Technology

Conceptual Modeling in ER and UML

Database Design. 4-1 Supertypes and Subtypes. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Transcription:

Credit where Credit is Due Lecture 22: Database Design Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2002 Some material presented in this lecture is taken from section 8 of Maciaszek s Requirements Analysis and System Design. Addison Wesley, 2000 April 4, 2002 Kenneth M. Anderson, 2002 2 Goals for this Lecture Cover the information presented in Section 8 of the textbook Discuss Persistent Database Layer Data Models Object database model Object-relational database model Relational database model Covered Last Lecture User Interface Design UI Design Process UI Guidelines Use of OO Models in UI Design April 4, 2002 Kenneth M. Anderson, 2002 3 April 4, 2002 Kenneth M. Anderson, 2002 4

Quiz 1. Draw a sequence diagram for the following scenario A registrar object creates a student object and adds the student to its school. The registrar object instructs the student to register for classes, so the student creates an empty schedule object and adds three courses to its schedule. The registrar object then sets the student s status to registered 2. Create the equivalent collaboration diagram Databases and Information Systems Information systems have multiple users that require acess to information stored in a database typically one database can support many applications (perhaps viewing different slices of the database s information) In OO Design, entity classes represent data that must be made persistent these classes must be mapped to a database; the particular mapping used depends on the data model employed by the target database April 4, 2002 Kenneth M. Anderson, 2002 5 April 4, 2002 Kenneth M. Anderson, 2002 6 Persistent Database Layer Maciaszek distinguishes between application design and database design The class models in his BCED packages represent application classes, not database classes as such, we still need to design what Maciaszek calls the persistent database layer this layer can be provided by a relational, object-relational, or object database Databases store data Data Models and present data models for representing the data that they store they also supply behavior models for things such as stored procedures and triggers Data models have three layers External (conceptual) data model typically, entity-relationship models Logical data model a model of the storage structures of a DBMS Physical data model specific to a database; it defines the physical storage of data on a disk April 4, 2002 Kenneth M. Anderson, 2002 7 April 4, 2002 Kenneth M. Anderson, 2002 8

Data Models, continued Figure 8.1 on page 277 demonstrates the relationships between application packages and the data models of a database Entity classes represent the external model UML class diagrams can repace ER diagrams Database package classes separate the entity classes from any particular database it communicates to the logical model on the database side, which then makes use of the physical model to store information on disk primary responsibility is to map objects in an OO system to data in the database April 4, 2002 Kenneth M. Anderson, 2002 9 Object mapping Mapping objects to a database can be problematic Firstly, the storage structures of a database may not be objectoriented this means that entity classes must be mapped to non-object-oriented structures even, sometimes, for object databases Secondly, a database is almost never designed for a single application (in modern information system applications) as such, database structures may be tuned to a high-priority information system and thus other information systems must make due with these structures and determine a way to fit in in addition, database structures must be designed with future applications in mind, which leads to more generic structures, which are less likely to be optimal for any one information system April 4, 2002 Kenneth M. Anderson, 2002 10 Object databases ODB Model present the least troublesome mapping between objects in an application and objects in a database indeed object databases try to make the mapping as transparent to a programmer as possible in addition, a query language, Object SQL is provided when making queries on objects outside of a programming environment April 4, 2002 Kenneth M. Anderson, 2002 11 Basic Modeling Primitives of ODB object (has OID) defined by classes, which have properties and operations atomic, structured, and collection objects literal (has no OID) atomic numbers, strings, etc. structured date, time, timestamp, interval collection set, bag, list, array, dictonary null April 4, 2002 Kenneth M. Anderson, 2002 12

ODB Model, continued The ODB model builds on the previous modeling primitives three relationship types association, aggregation, generalization see figure 8.3 on page 281 ODB defines two types of generalization ISA (interface inheritance) EXTENDS (implementation inheritance) see figure 8.4 on page 282 built in operations listed on pages 282-284 Mapping objects with ODB Mapping UML class models to ODB is relatively straightforward See example 8.1 on page 285 for details in mapping entity classes The example invents some questions to ask of the analysis class model of the Contact Management case study e.g. How do I manage an employee having more than one phone number? or Can I model an employee name as a single attribute with internal structure (first, middle, last) without creating a separate employee name class? Example 8.2 on pg 286 demonstrates mapping assoications between objects to ODB April 4, 2002 Kenneth M. Anderson, 2002 13 April 4, 2002 Kenneth M. Anderson, 2002 14 Mapping aggregations in ODB Mapping generalizations in ODB ODB does not directly support aggregations aggregations are simply modeled as associations (e.g. by using ODB collection classes) semantics must be enforced using stored procedures compositions are modeled by creating a separate ODB class that represents the container this container contains an attribute using an ODB collection class that stores values of the component class Example 8.3 on pages 288 and 289 demonstrate mapping aggregation and composition relationships Very straightforward Inheriting from an ODB interface results in an ISA relationship Inheriting from an ODB class results in an EXTENDS operation Example 8.4 on page 289 presents an example of this type of mapping April 4, 2002 Kenneth M. Anderson, 2002 15 April 4, 2002 Kenneth M. Anderson, 2002 16

Object-Relational Data Model ORDB modeling primitives Object-Relational models combine the new object model with the old relational model A single DBMS can process relational tables and object tables The ORDB model was standardized in 1999, also known as SQL 99 upward compatible with SQL 92 extends relational model to allow objects to be stored in SQL tables also extends model to allow the specification of arbitrarily complex structured types (e.g. classes) April 4, 2002 Kenneth M. Anderson, 2002 17 ORDB provides a structured type that corresponds to ODB s interface and UML s class structured type is defined by specifying attributes and operations subtype relationships can be specified structured types are stored in tables columns in tables can be structured types (object tables) ODB structured and collection types are supported row types can be used to nest structured types and provide navigation between structured types April 4, 2002 Kenneth M. Anderson, 2002 18 Mapping to ORDB More difficult to do, because existing database systems do not completely support the SQL 99 standard as such, a mapping must be done to a particular DBMS, not to the standard I will, hence, skip this section of chapter 8 Relational Data Model The relational model has been dominant for over 20 years as such, inertia will keep relational databases in business for years (decades) to come RDB was last standardized with SQL 92 April 4, 2002 Kenneth M. Anderson, 2002 19 April 4, 2002 Kenneth M. Anderson, 2002 20

Relational Modeling Primitives Mapping objects to RDB Tables consist of columns Columns can only contain values of atomic types ODB s object types, structured types, collections, and references are not supported references between tables are maintained by comparing values in columns Complete set of primitives shown in figure 8.16 on page 302 April 4, 2002 Kenneth M. Anderson, 2002 21 See figure 8.17 on page 304 for an example of modeling an entity class as a table See figure 8.18 on page 305 for an example of modeling a relationship between classes A referential integrity link says that the values for a particular column in one table must come from the values of a column (often with the same name) in another table constraints may be placed on this referential integrity link to determine what happens when a table is updated or deleted Many to Many relationships are modeled by introducing a new table (see figure 8.19 on page 306) Note, other than these basic examples, I do not require indepth knowledge of this subject April 4, 2002 Kenneth M. Anderson, 2002 22