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.

Slides:



Advertisements
Similar presentations
Mastering Object-Oriented Analysis and Design with UML Module 4: Analysis and Design Overview.
Advertisements

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
© Copyright 2011 John Wiley & Sons, Inc.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
The Relational Database Model:
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
Chapter 5 Normalization of Database Tables
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
SE 555 Software Requirements & Specification Requirements Analysis.
Object Oriented Analysis and Design Using the UML
Client/Server Software Architectures Yonglei Tao.
Chapter 5: Modeling Systems Requirements: Events and Things
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.
UML - Development Process 1 Software Development Process Using UML (2)
Systems Analysis and Design in a Changing World, Fifth Edition
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 1: Introduction to Systems Analysis and Design
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 10: Class and Method.
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Use-Case Design.
Slide 1 UML Review Chapter 2: Introduction to Object-Oriented Systems Analysis and Design with the Unified Modeling Language, Version 2.0 Alan Dennis,
Unified Modeling Language, Version 2.0
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Information System Development Courses Figure: ISD Course Structure.
Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence.
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.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Wixom, and David Tegarden Chapter 8: Behavioral Modeling.
Chapter 12: Designing Databases
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
Object Oriented Analysis and Design using the UML CIS 520 Advanced Object-Oriented Design.
1 IBM Software Group ® Mastering Object-Oriented Analysis and Design with UML 2.0 Module 6: Use-Case Analysis.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 10: Class and Method.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Wixom, and David Tegarden Chapter 8: Behavioral Modeling.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Wixom, and David Tegarden Chapter 6: Functional Modeling.
1 IBM Software Group ® Mastering Object-Oriented Analysis and Design with UML 2.0 Module 9: Describe the Run-time Architecture.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
Object Oriented Analysis and Design using the UML Use-Case Analysis Adapted by Dr. Spiegel from Slides Provided by Rational Software.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
1 IBM Software Group ® Mastering Object-Oriented Analysis and Design with UML 2.0 Module 4: Analysis and Design Overview.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Wixom, and David Tegarden Chapter 9: Moving on to Design.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Wixom, and David Tegarden Chapter 8: Behavioral Modeling.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Basic Characteristics of Object-Oriented Systems
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Use Case Analysis – Part 4 Analysis Mechanisms.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
DATA REQIREMENT ANALYSIS
Client/Server Databases and the Oracle 10g Relational Database
Copyright © 2014 Hassan Gomaa and Robert Pettit
Systems Analysis and Design With UML 2
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Object Relational Mapping Tools
Software Development Process Using UML Recap
Systems Analysis and Design with UML Version 2.0, Second Edition
Presentation transcript:

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 original slides resides with IBM/Rational. They are used here, in this course, under password protection limited to students enrolled in the course, with permission of the owners, but are not to be published or further distributed. Other slides are derived from Dennis, Wixom & Tegarden Systems Analysis & Design with UML, 3 rd edition, copyright John Wiley & Sons, used under similar permissions.

Objectives: Database Design Define the purpose of Database Design and where in the lifecycle it is performed Explain how persistent classes map to the data model Learn how to distribute class behavior to the database

Database Design in Context [Early Elaboration Iteration] [Inception Iteration (Optional)] Define a Candidate Architecture Perform Architectural Synthesis Analyze Behavior Refine the Architecture Design Components Design the Database (Optional) Database Design Database Designer

Database Design Overview Supplementary Specifications Database Design Use-Case Realization Project Specific Guidelines Analysis Classes Design Classes Design ModelData Model

Database Design Steps Map persistent design classes to the data model Distribute class behavior to the database

Database Design Steps Map persistent design classes to the data model Distribute class behavior to the database

Not entirely compatible – RDBMS Focus is on data Better suited for ad-hoc relationships and reporting application Expose data (column values) – Object Oriented system Focus is on behavior Better suited to handle state-specific behavior where data is secondary Hide data (encapsulation) Relational Databases & Object Orientation

The Relational Data Model Relational model is composed of – Entities – Attributes – Relations ORDERLINE ITEM PRODUCT Order_Id LineItem_Id Description Price Quantity Product_Id Order_Id Product_Id Name Price lineItem order products lineItems Entity Relation Columns (aka Attributes) An ERD diagramAn ERD diagram

The Object Model The Object Model is composed of – Classes – Attributes – Associations LineItem - quantity : Integer - number : Integer 1..* +lineItems Order - number : Integer +order Product - number : Integer - description : String - unitPrice : Double 1 Software Product - version : Double Hardware Product - assembly : String A class diagram

Persistence Frameworks Challenge: – Changes should not break the model Solution: an object-relational framework that – Encapsulates the physical data store – Provides object translation services Importance of the framework – 30% of development time is spent in accessing an RDBMS – Maintenance can be 60% of total cost Business Object Model Relational Database Compact interfaces Object-relational translation Encapsulates data store

Object-Relational Framework: Characteristics Performance – Decomposing objects to data – Composing objects from data Minimize design compromises – Limit changes to object and relational models Make it extensible – 15%-35% of the application will require extensions to the framework

Object-Relational Frameworks: Characteristics (continued) Documentation of the API Documentation of internals, for extension Support for common object-relational mappings Persistence interfaces – Examples are save, delete, and find

Common Object-Relational Services Patterns are beginning to emerge for object-relational applications – CORBA Services specification Persistence Query - e.g., “find”, “find unique” Transactions Concurrency Relationships Refer to the appropriate CORBA specifications for further details.

Student - name : String - address : String - studentID : Long 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 NameAddressStudent_ID Thomas Stuart987 High St Object Instance Attributes from object type

Mapping Associations Between Persistent Objects Associations between two persistent objects are realized as foreign keys to the associated objects. – A foreign key is a column in one table that 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

Mapping Aggregation to the Data Model Aggregation is also modeled using foreign key relationships – The use of composition implements a cascading delete constraint Student. - studentID : int Schedule - semester : Semester 0..* 1 Student_IDSemester Spring 2001 Schedule table Student_ID Foreign Key Primary Key Student table

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)

Database Design Steps Map persistent design classes to the data model Distribute class behavior to the database

What Are Stored Procedures? A stored procedure is executable code that runs under the RDBMS Two types of stored procedures: – Procedures: Executed explicitly by an application – Triggers: Invoked implicitly when some database event occurs

Map Class Behavior to Stored Procedures Determine if any operations can be implemented as a stored procedure Candidates: – Operations that deal with persistent data – Operations in which a query is involved in a computation – Operations that need to access the database to validate data

Example: Map Class Behavior to Stored Procedures Student. + getTuition() + addSchedule() + getSchedule() + deleteSchedule() + hasPrerequisites() # passed() + getNextAvailID() + getStudentID() + getName() + getAddress() ClassCandidate Operations getTuition addSchedule getSchedule deleteSchedule getStudentID getName getAddress

Checkpoints: Database Design Have all persistent classes been mapped to database structures? Have stored procedures and triggers been defined? Does the persistence mechanism use stored procedures and database triggers consistently?

Review: Database Design What is the purpose of the Database Design? What comprises a relational data model? What are the components of an object model? When mapping persistent classes to tables, what is every row in a table regarded as? What is every column equivalent to? What are stored procedures?