Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
Data Bits Sets Trans- actions Specials Domains Normalization $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 Final DataBit.
Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
A Practical Introduction to Transactional Database Modeling and Design Mike Burr.
ETEC 100 Information Technology
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Hibernate 1. Introduction ORM goal: Take advantage of the things SQL databases do well, without leaving the Java language of objects and classes. ORM.
Data Management Design
Chapter 11 Data Management Layer Design
Summary. Chapter 9 – Triggers Integrity constraints Enforcing IC with different techniques –Keys –Foreign keys –Attribute-based constraints –Schema-based.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
July 14, 2015ICS 424: recap1 Relational Database Design: Recap of ICS 324.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Transforming Data Models into Database Designs
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 11: Data Management Layer Design Alan Dennis, Barbara.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 2-1 David M. Kroenke’s Chapter One: Why DB? Database Processing: Fundamentals,
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
Data Access Patterns Some of the problems with data access from OO programs: 1.Data source and OO program use different data modelling concepts 2.Decoupling.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
Database Technical Session By: Prof. Adarsh Patel.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Part 2: EJB Persistency Jianguo Lu. 2 Object Persistency A persistent object is one that can automatically store and retrieve itself in permanent storage.
Object Persistence (Data Base) Design Chapter 13.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
MIS 327 Database Management system 1 MIS 327: DBMS Dr. Monther Tarawneh Dr. Monther Tarawneh Week 2: Basic Concepts.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Database Design Some of these slides are derived from IBM/Rational slides from courses on UML and object-oriented design and analysis. Copyright to the.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 3 The Relational Database Model.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Session 1 Module 1: Introduction to Data Integrity
Persistence – Iteration 4 Vancouver Bootcamp Aaron Zeckoski
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
1 Storing and Maintaining Semistructured Data Efficiently in an Object- Relational Database Mo Yuanying and Ling Tok Wang.
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
Faeez, Franz & Syamim.   Database – collection of persistent data  Database Management System (DBMS) – software system that supports creation, population,
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Hibernate Java Persistence API. What is Persistence Persistence: The continued or prolonged existence of something. Most Applications Achieve Persistence.
SQL Basics Review Reviewing what we’ve learned so far…….
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Business System Development
Persistence – Iteration 4 Vancouver Bootcamp
Lecture 2 The Relational Model
Relational Algebra Chapter 4, Part A
Database Fundamentals
Physical Database Design
The Relational Model Textbook /7/2018.
Data Model.
Databases and Information Management
Review #1 Intro stuff What is a database, 4 parts, 3 users, etc.
Presentation transcript:

Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence Frameworks  Database Design

Object Oriented Analysis and Design 2 UML Specification for Data Modeling

Object Oriented Analysis and Design UML Specification for Data Modeling  UML Notation for Data Modeling  Modeling Associations in the Data Model  Modeling Aggregation in the Data Model  Modeling Inheritance in the Data Model

Object Oriented Analysis and Design 4 UML Notation for Data Modeling

Object Oriented Analysis and Design 5 Modeling Associations in the Data Model  Associations between two persistent objects are realized as foreign keys to the associated objects.  A foreign key is a column in one table which contains the primary key value of associated object NumberCourse_ID NameDescriptionNumber Math 101Algebra Course Offering table Course table Course - name - description - number CourseOffering - number : String 0..* 1 Primary Key Foreign Key

Object Oriented Analysis and Design 6 Modeling Aggregation in the Data Model  Aggregation is also modeled using foreign key relationships  Using composition implements a cascading delete constraint Student. - studentID : int Schedule - semester : Semester 0..* 1 1 Student_IDSemester Spring 2001 Schedule table Student_ID Foreign Key Primary Key Student table

Object Oriented Analysis and Design 7 Modeling Inheritance in the Data Model  A data model does not support modeling inheritance in a direct way  Two options  Use separate tables (normalized data)  Duplicate all inherited associations and attributes (de-normalized data)

Object Oriented Analysis and Design 8 Modeling Inheritance in the Data Model - Example

Object Oriented Analysis and Design 9 Modeling Inheritance in the Data Model - Example

Object Oriented Analysis and Design 10 Modeling Inheritance in the Data Model - Example

Object Oriented Analysis and Design 11 Modeling Inheritance in the Data Model - Example

Object Oriented Analysis and Design 12 Modeling Inheritance in the Data Model - Example

Object Oriented Analysis and Design 13 The Relational Data Model and Object Model

Object Oriented Analysis and Design The Relational Data Model and Object Model  The Relational Data Model  The Object Model

Object Oriented Analysis and Design 15 The Relational Data Model  The relational model is composed of entities and relations. An entity may be a physical table or a logical projection of several tables also known as a view.

Object Oriented Analysis and Design 16 The Object Model  An object model contains classes. Classes define the structure and behavior of a set of objects, sometimes called objects instances. The structure is represented as attributes (data values) and associations (relationships between classes).

Object Oriented Analysis and Design 17 The Persistence Frameworks

Object Oriented Analysis and Design Persistence Frameworks  The Purpose of a Persistence Framework  Hibernate

Object Oriented Analysis and Design 19 The Purpose of a Persistence Framework

Object Oriented Analysis and Design 20 Hibernate  Object / Relational mapping (ORM) and persistence / query framework  i.e. It does even more stuff for you!  Some features of Hibernate  HibernateDaoSupport – superclass, easy HibernateTemplate access  Database independence - sits between the database and your java code, easy database switch without changing any code  Object / Relational Mapping (ORM) - Allows a developer to treat a database like a collection of Java objects  Object oriented query language (HQL) - *Portable* query language, supports polymorphic queries etc.  You can also still issue native SQL, and also queries by “Criteria” (specified using “parse tree” of Java objects)  Hibernate Mapping - Uses HBM XML files to map value objects (POJOs) to database tables  Transparent persistence - Allows easy saves/delete/retrieve for simple value objects  Very high performance “in general” due to intelligent (2-level) caching, although in a few cases hand-written SQL might beat it

Object Oriented Analysis and Design 21 Hibernate  Hibernate basically sits between the DB and your code  Can map persistent objects to tables

Object Oriented Analysis and Design 22 Database Design

Object Oriented Analysis and Design Database Design  Purpose  Overview  Steps  Map persistent design classes to tables  Distribute class behavior to the database

Object Oriented Analysis and Design 24 Purpose  To ensure that persistent data is stored consistently and efficiently.  To define behavior that must be implemented in the database.

Object Oriented Analysis and Design 25 Database Design Overview Supplementary Specifications Database Design Use-Case Realization Design Classes Design Guidelines Data Model

Object Oriented Analysis and Design 26 Steps  Map Persistent Design Classes to the Data Model  Optimize the Data Model for Performance  Optimize Data Access  Define Storage Characteristics  Define Reference Tables  Define Data and Referential Integrity Enforcement Rules  Distribute Class Behavior to the Database  Review the Results

Object Oriented Analysis and Design 27 Mapping Persistent Classes to Tables  In a relational database  Every row is regarded as an object  A column in a table is equivalent to a persistent attribute of a class NameStudent_ID Thomas Stuart Object Instance Attributes from object type

Object Oriented Analysis and Design 28 Mapping Persistent Classes to Tables - Example

Object Oriented Analysis and Design 29 Map Class Behavior to Stored Procedures  Determine if any operations can be implemented as a stored procedure  Candidate operations  Deal with persistent data  Any operations where a query is involved in a computation  Need to access the database to validate data

Object Oriented Analysis and Design 30 What Are Stored Procedures?  A stored procedure is executable code which runs under the RDBMS  Two types of stored procedures  Procedures: Executed explicitly by an application  Triggers: Invoked implicitly when some database event occurs

Object Oriented Analysis and Design 31 Example: Map Class Behavior to Stored Procedures ClassCandidate Operations getTuition addSchedule getSchedule deleteSchedule getStudentID getName getAddress

Object Oriented Analysis and Design 32 Example: Map Class Behavior to Stored Procedures