Challenges of Teaching OO Constructs with Databases Shahram Ghandeharizadeh Database Laboratory Computer Science Department University of Southern California.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Introduction to Databases
Sunday, June 28, Entity-Relationship and Enhanced Entity-Relationship Conceptual Data Models (Chapters 6 & Section 7.1)
“DOK 322 DBMS” Y.T. Database Design Hacettepe University Department of Information Management DOK 322: Database Management Systems.
8/28/97Information Organization and Retrieval Files and Databases University of California, Berkeley School of Information Management and Systems SIMS.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
BUSINESS DRIVEN TECHNOLOGY
Compe 301 ER - Model. Today DBMS Overview Data Modeling Going from conceptual requirements of a application to a concrete data model E/R Model.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Chapter 4 Database Management Systems. Chapter 4Slide 2 What is a Database Management System (DBMS)?  Database An organized collection of related data.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
CSC2012 Database Technology & CSC2513 Database Systems.
6-1 DATABASE FUNDAMENTALS Information is everywhere in an organization Information is stored in databases –Database – maintains information about various.
1 Data Modeling : ER Model Lecture Why We Model  We build models of complex systems because we cannot comprehend any such system in its entirety.
1 CSCI485 – File & Database Management Systems Bahram Zartoshty Office: SAL 346 Phone: TBA Office Hours: TTH 1:15-2:50pm Note: Parts of this lecture were.
Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.
Course Introduction Introduction to Databases Instructor: Joe Bockhorst University of Wisconsin - Milwaukee.
Web-Enabled Decision Support Systems
Database Technical Session By: Prof. Adarsh Patel.
Introduction to SQL Steve Perry
STORING ORGANIZATIONAL INFORMATION— DATABASES CIS 429—Chapter 7.
Introduction to Database Systems
1 CS U430: Database Design Spring 2006 Panfeng (Tony) Zhou.
CS 474 Database Design and Application Terminology Jan 11, 2000.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 5 The Relational Data Model.
Computer Science 101 Database Concepts. Database Collection of related data Models real world “universe” Reflects changes Specific purposes and audience.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
SQL Structured Query Language Programming Course.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
File Systems and Databases Lecture 1. Files and Databases File: A collection of records or documents dealing with one organization, person, area or subject.
Storing Organizational Information - Databases
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
Chapter 12: Designing Databases
Chapter 4 Database Processing Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall 4-1.
Lecture 1: Overview of CSCI 485 Notes: I presented parts of this lecture as a keynote at Educator’s Symposium of OOPSLA Shahram Ghandeharizadeh Associate.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 7 Storing Organizational Information - Databases.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Introduction HNDIT DBMS 1. Database Management Systems Module code HNDIT Module title Database Management Systems Credits2HoursLectures15.
An Introduction to Web Services and Proteus’ RTI S. Ghandeharizadeh, E. Alwagait, S. Manjunat Database Lab., CS Department
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
3/6: Data Management, pt. 2 Refresh your memory Relational Data Model
Object storage and object interoperability
An Introduction to Database Systems دانشگاه علم و فناوری مازندران - طراحی و ایجاد بانک های اطلاعاتی 1.
Jemerson Pedernal IT 2.1 FUNDAMENTALS OF DATABASE APPLICATIONS by PEDERNAL, JEMERSON G. [BS-Computer Science] Palawan State University Computer Network.
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
Performance of Networked XML-Driven Cooperative Applications S. Ghandeharizadeh, C. Papadopoulos M. Cai, K. Chintalapudi, Parakshit Pol, S. Song, R. Schmidt,
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Chapter 1: Introduction. 1.2 Database Management System (DBMS) DBMS contains information about a particular enterprise Collection of interrelated data.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
1 Lecture1 Introduction to Databases Systems Database 1.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
CSCI 599: Beyond Web Browsers Professor Shahram Ghandeharizadeh Computer Science Department Los Angeles, CA
Lecture 1: Overview of CSCI 485 Shahram Ghandeharizadeh Associate Professor Computer Science Department University of Southern California Presented by:
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Fundamental of Database Systems
Tools for Memory: Database Management Systems
A SIMPLE GUIDE TO FIVE NORMAL FORMS (See the next slide for required reading) Prof. Ghandeharizadeh 2018/11/14.
Data Model.
Lecture 1: Overview of CSCI 485 Notes: I presented parts of this lecture as a keynote at Educator’s Symposium of OOPSLA Shahram Ghandeharizadeh Director.
Lecture 1: Overview of CSCI 485 Notes: I presented parts of this lecture as a keynote at Educator’s Symposium of OOPSLA Shahram Ghandeharizadeh Associate.
Presentation transcript:

Challenges of Teaching OO Constructs with Databases Shahram Ghandeharizadeh Database Laboratory Computer Science Department University of Southern California

Outline An overview of Introductory course to databases. An overview of Introductory course to databases. Object-oriented challenges. Object-oriented challenges. Future role of object-oriented constructs in data intensive applications. Future role of object-oriented constructs in data intensive applications.

Database Systems Used almost on a daily basis for either individual or business use. Used almost on a daily basis for either individual or business use. Relational database vendors were one of the fastest growing sectors during the.COM boom! Relational database vendors were one of the fastest growing sectors during the.COM boom!

Data Models Build a database of all my assets for licensing and royalty collection

Data Models Conceptual Logical Physical

Relational DBMS Why? Why?  Performance!  Reduced application development time  Use of SQL makes access to data more uniform:  Software modularity,  Extensibility

Challenge 1 Make students aware of the importance of conceptual data modeling. Make students aware of the importance of conceptual data modeling.

Challenge 1 Make students aware of the importance of conceptual data modeling. Make students aware of the importance of conceptual data modeling. Solution: Solution:  No-one builds a house without a design.

Challenge 1 Make students aware of the importance of conceptual data modeling. Make students aware of the importance of conceptual data modeling. Solution: Solution:  No-one builds a house without a design.  Michael Jackson is picky and won’t pay for a system that does not meet his requirements.

Relational DBMS Why? Why?  Performance!  Reduced application development time  Use of SQL makes access to data more uniform:  Software modularity,  Extensibility

Challenge 2 Two ways to teach this course: Two ways to teach this course:  How to implement a DBMS?  Protocols to realize atomic property of transactions  How to use a DBMS?  Setup a web server with a database and build a shopping bag Key difference: discussion at both the logical and physical levels Key difference: discussion at both the logical and physical levels Both require use of OO constructs Both require use of OO constructs

Challenges Conceptual Logical Physical Abstraction, Inheritance, Encapsulation Reduction to tables with minimal: data duplication, potential for data loss and update anomalies Effective use of a DBMS, management of mismatch between tables and OO constructs

Conceptual Data Models Entity-Relationship (ER) data model Entity-Relationship (ER) data model  Entities, Attributes, Relationships Emp SS# name address

Conceptual Data Models Entity-Relationship (ER) data model Entity-Relationship (ER) data model  Entities, Attributes, Relationships Enrolled in Emp SS# name address Health Plan name Co-Pay

Conceptual Data Models Entity-Relationship (ER) data model Entity-Relationship (ER) data model  Entities, Attributes, Relationships  Recursive relationships Married to Emp SS# name address

Conceptual Data Models Entity-Relationship (ER) data model Entity-Relationship (ER) data model  Entities, Attributes, Relationships  Recursive relationships Works for Emp SS# name address

Conceptual Data Models Entity-Relationship (ER) data model Entity-Relationship (ER) data model  Entities, Attributes, Relationships  Recursive relationships Works for Emp SS# name address date

Conceptual Data Models Entity-Relationship (ER) data model Entity-Relationship (ER) data model  Entities, Attributes, Relationships  Recursive relationships  Inheritance sid student name ISA graduate Undergrad Specialization Generalization

Conceptual Data Models Abstraction, Inheritance, Encapsulation Abstraction, Inheritance, Encapsulation Exercise these concepts using in-class examples and homework assignments Exercise these concepts using in-class examples and homework assignments  A library database contains a listing of authors who have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects.

Conceptual Data Models Abstraction, Inheritance, Encapsulation Abstraction, Inheritance, Encapsulation Exercise these concepts using in-class examples and homework assignments Exercise these concepts using in-class examples and homework assignments  A library database contains a listing of authors who have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects.  Entity sets: authors, subjects, books, libraries  Relationship sets: wrote, carry, indexed

Conceptual Data Models Abstraction, Inheritance, Encapsulation Abstraction, Inheritance, Encapsulation Exercise these concepts using in-class examples and homework assignments Exercise these concepts using in-class examples and homework assignments  A library database contains a listing of authors who have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects. carry books indexwrote subjectauthors SS# name titleisbn Subject matter libraries address

Data Models Logical Physical Works for Emp SS# name address

Relational Data Model Prevalent in today’s market place. Prevalent in today’s market place.  Why? Performance! Everything is a table! Everything is a table! Logical data design is the process of reducing an ER diagram to a collection of tables. Logical data design is the process of reducing an ER diagram to a collection of tables.

Logical Data Design Trivial reduction: Trivial reduction:  An entity set = a table  A relationship set = a table Pitfalls: Pitfalls:  Duplication of data  Unintentional loss of data  Data ambiguity that impacts software design, resulting in update anomalies

Data Duplication Works for Emp SS# name address 396ShahramSeattle 400AsokeChicago 200Joe New York SS#NameAddress SS#MGRSS#

Data Duplication The SS# column is duplicated! The SS# column is duplicated! Works for Emp SS# name address 396ShahramSeattle 400AsokeChicago 200Joe New York SS#NameAddress SS#MGRSS#

Data Duplication: Solution Merge the two tables into one: Merge the two tables into one: 396ShahramSeattle AsokeChicagoNULL 200Joe New York 400 SS#NameAddressMGRSS# Works for Emp SS# name address

Data Loss Ford maintains warehouses containing different automobile parts Ford maintains warehouses containing different automobile parts Records are inserted and deleted based on availability of a part at a warehouse Records are inserted and deleted based on availability of a part at a warehouse 123PistonTijuana 203CylinderMichigan 877BumperMichigan 389SeatsArizona Part#DescriptionLocation

Data Loss (Cont…) When a warehouse becomes empty, it is lost from the database: When a warehouse becomes empty, it is lost from the database: Solution: utilize two different tables Solution: utilize two different tables 123PistonTijuana 389SeatsArizona Part#DescriptionLocation 123Piston12389Seats45 Part#DescriptionWHID 12Tijuana45Arizona WHIDLocation

Data Ambiguity Represent faculty of a department as: Represent faculty of a department as: A change of address for a faculty might be for the entire department. This cannot be differentiated with this table design! A change of address for a faculty might be for the entire department. This cannot be differentiated with this table design! Ghandeharizadeh Comp Sci SAL Papadopoulos SAL Bohem SAL FacultyDepartmentLocation

Data Ambiguity Utilize two tables: Utilize two tables: Ghandeharizadeh Comp Sci Papadopoulos Jenkins Bio Medical Bohem Comp Sci FacultyDepartment SAL Sex Ed BOVARD Bio Medical HEDCO DepartmentLocation

Data Ambiguity (Cont…) Employees of a bi-lingual company having different skills. Employees of a bi-lingual company having different skills. Update anomalies! Update anomalies! AsokeTeachHindi AsokeCookFrench AsokeNullGerman AsokeProgramEnglish EmployeeSkillLanguage

Data Ambiguity: Solution Utilize two tables: Utilize two tables: AsokeTeach AsokeCook AsokeProgram EmployeeSkill AsokeHindiAsokeFrench AsokeGerman AsokeEnglish EmployeeLanguage

Logical Data Design A quest to flatten objects with minimal data duplication, loss of data, and update anomalies! A quest to flatten objects with minimal data duplication, loss of data, and update anomalies! William Kent, “A Simple Guide to Five Normal Forms in Relational Database Theory”, Communications of the ACM 26(2), Feb 1983, William Kent, “A Simple Guide to Five Normal Forms in Relational Database Theory”, Communications of the ACM 26(2), Feb 1983,

Data Models Physical Works for Emp SS# name address Logical Data Design 396ShahramSeattle400400AsokeChicagoNull SS#NameAddress MGR SS#

Physical Implementation Reconstruct main memory objects for manipulation and presentation: Reconstruct main memory objects for manipulation and presentation:  Specify class definitions  Typically correspond to entity-sets  Populate an instance of a class by issuing SQL queries to a DBMS  Update instances in memory  Flush dirty instances back to DBMS  Potential use of transactions

Type Mismatch A column of a row must be a primitive such as an integer, real, etc. A column of a row must be a primitive such as an integer, real, etc.  It may NOT be an array of integers or object pointers A property (attribute) of a class might be of a multi-valued type, e.g., an array, a vector, etc. A property (attribute) of a class might be of a multi-valued type, e.g., an array, a vector, etc. Changes in software may impact the design of tables. (Management of type mismatch by the system designer.) Changes in software may impact the design of tables. (Management of type mismatch by the system designer.)

Implementation Set operators in the DBMS Set operators in the DBMS  Does set A contain set B?  Does value v1 appear in set A? Aggregates in the DBMS Aggregates in the DBMS  Compute average employee salary  Count the number of employees  Find the oldest employee

Challenges Conceptual Logical Physical Abstraction, Inheritance, Encapsulation Reduction to tables with minimal: data duplication, potential for data loss and update anomalies Effective use of a DBMS, management of mismatch between tables and OO constructs

A Shift in Computing Server-centricDistributed Dumb clientsSmart clients Hardware-drivenSoftware-driven User to appUser to app; app to app Information accessInformation action One-wayTwo-way Monolithic islandspeer-to-peer Integration an afterthoughtIntegration by design Challenge: scaleChallenge: value Internet

Future Vision In the future, any two IT components will automatically integrate and “communicate” with one another, even though they were not specifically designed to interoperate In the future, any two IT components will automatically integrate and “communicate” with one another, even though they were not specifically designed to interoperate How? How?  Semantics  Standards  Concept of “software and data” as a service, web service, e.g.,  Google as a web service  Microsoft Teraserver web services  Experian (TRW) credit report web services  Etc.

XML A standard for data interoperability among web services A standard for data interoperability among web services  Language independent  Sun’s Java, Microsoft’s C#  Device and software platform independent Motorola i85s Motorola i85s J2ME J2ME Compaq iPAQ Compaq iPAQ Windows CE Windows CE StrongARM StrongARM PERL PERL Apache 2.0 Apache 2.0 MySQL MySQL Linux Linux.NET.NET SQL 2000 SQL 2000 Commerce server Commerce server Windows 2000 Windows 2000

Future Challenge Educate students to see Internet as an object-oriented software platform! Educate students to see Internet as an object-oriented software platform! Software at an Internet scale must be: Software at an Internet scale must be:  Robust: Physical location independence  Ensure availability of data and functionality at all times  Modular and Extendible  Integrate with other software components