Data Modelling 2014, Fall Pusan National University Ki-Joune Li.

Slides:



Advertisements
Similar presentations
Object-oriented modeling Class/Object Diagrams
Advertisements

CRC Modeling. Recap Class Modeling – How to Identify classes, its attributes and functions? – Class selection criteria – Relationships Associations Generalization.
1 Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – EER Model –21th June.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Chapter 14 (Web): Object-Oriented Data Modeling
UML Class Diagram and Packages
Fundamentals, Design, and Implementation, 9/e COS 346 Day 2.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Entity-Relationship (E-R) Model
Chapter 14: Object-Oriented Data Modeling
Enhanced Entity-Relationship Model (EER) 1. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
Chapter 14: Object-Oriented Data Modeling
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.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Entities and Attributes
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
1 Announcements Research Paper due Friday November 19 For Wednesday read
Chapter 5 Entity–Relationship Modeling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 2/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
1 © Prentice Hall, 2002 Chapter 14: Object-Oriented Data Modeling Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
بسم الله الرحمن الرحيم ” اللهم أنت ربي لا إله إلا أنت خلقتني و أنا عبدك وأنا على عهدك ووعدك ما استطعت ، أعوذ بك من شر ما صنعت ، أبوء لك بنعمتك على و أبوء.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Class-based Modeling.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 24. Review ANALYSIS Level Class Diagram – Identifying Entities – Identifying Attributes – Identifying Operations.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
Class Diagram Classes are the most important building block of any object-oriented system. A class is a description of a set of objects that share the.
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
advanced data modeling
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
Modeling the Static Structure: Relationships ©SoftMoore ConsultingSlide 1.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
© Shamkant B. Navathe CC Enhanced Entity-Relationship Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
1 Unified Modeling Language. 2 UML  UML is designed to model software, but has been adapted as a database modeling language. – No multiway relationships.
Enhanced Entity-Relationship and UML Modeling. 2.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles.
The Entity-Relationship Diagram for Data Modeling
ER Diagrams ● Many different notations are available ● From wikipedia:wikipedia: Entity-relationship modelwikipedia: Entity-relationship model ● How do.
Unified Modeling Language (UML)
COMP 2710 Software Construction Class Diagrams
Entity-Relationship Model
Class diagram Description
Lec 3: Object-Oriented Data Modeling
2018, Fall Pusan National University Ki-Joune Li
UML Class Diagram.
Unified Modelling Language
2019, Fall Pusan National University Ki-Joune Li
Presentation transcript:

Data Modelling 2014, Fall Pusan National University Ki-Joune Li

A brief history - What did Edgar F. Codd do in 1970? 2 In his historical paper, Codd, E. F. (1970). "A relational model of data for large shared data banks". Communications of the ACM 13 (6): 377."A relational model of data for large shared data banks" o He proposed a mathematical model to handle data in an algebraic way with a set of operators. o It is called Relational Data Model o Homework assignment #1: Write a short biography of Dr. Codd and summarize his paper in CACM, 1970

And Peter Chen did in 1976 Peter Chen, "The Entity-Relationship Model - Toward a Unified View of Data". ACM Transactions on Database Systems 1 (1), March, 1976The Entity-Relationship Model - Toward a Unified View of Data o More expressive power o Everything by means of  Entity Set and  Relationship 3

Then Object-Modeling Technique (OMT) James Rumbaugh, et al., 1990, Object-Oriented Modeling and Design. Prentice Hall. ISBN James RumbaughISBN o More Advanced than Object-Oriented Modeling Then it has been unified into UML in o UML (Unified Modeling Language) 4 J. Rumbaugh G. Booch

5 What is a Class Diagram? A class diagram describes o the types of objects in the system and o the various kinds of static relationships that exist among them. o A graphical representation of a static view on declarative static elements. A central modeling technique that runs through nearly all object-oriented methods. The richest notation in UML

6 Essential Elements of a UML Class Diagram Class Attributes Operations Relationships o Associations o Generalization o Dependency o Realization Constraint Rules and Notes

7 Classes A class: Description of a set of objects having similar o attributes, o operations, o relationships and behavior An entity type to be stored in DB Window size: Size visibility: boolean display() hide() Class Name Attributes Operations

8 Associations A semantic relationship between classes o To specify connections among their instances. A structural relationship o To specify that objects of one class are connected to objects of a second (possibly the same) class. Example o An Employee works for a Company

9 Example Staff MemberStudent 1..* *instructs instructor Association name Role name Multiplicity Navigable (uni-directional) association Courses pre -requisites 0..3 Reflexive association Role *

10 Associations: Name and Role Association has a name o To clarify its meaning o The name is represented as a label placed midway along the association line. o Usually a verb or a verb phrase. A role is an end of an association where it connects to a class. o May be named to indicate the role played by the class attached to the end of the association path.  Usually a noun or noun phrase  Mandatory for reflexive associations

11 Associations: Multiplicity or Cardinality Multiplicity o The number of instances of the class associated with an instance of the class with the association o Indicates whether or not an association is mandatory. o Provides a lower and upper bound on the number of instances

12 Associations: Notations for Multiplicity Multiplicity Indicators Exactly one1 Zero or more (unlimited)* (0..*) One or more1..* Zero or one (optional association)0..1 Specified range2..4 Multiple, disjoint ranges2, 4..6, 8

13 Association Class CompanyPerson 0..* 1..* works for employer employee Contract - Salary - Position

14 Aggregation A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts. o Models a “is a part-part of” relationship. Whole Part Car Door House 1..*2..* ??

15 Composition A strong form of aggregation o The whole is the sole owner of its part.  The part object may belong to only one whole o Multiplicity on the whole side must be zero or one. o The life time of the part is dependent upon the whole.  The composite must manage the creation and destruction of its parts. CirclePoint 3..* 1 Polygon Point Circle

16 Generalization Any object of the specialized class (subclass) is a concrete objects of the generalized class (super-class). o “is kind of” relationship. Shape {abstract} Circle Super Class Sub Class An abstract class Generalization relationship {abstract} is a tagged value that indicates that the class is abstract. The name of an abstract class should be italicized

17 Generalization: Inheritance A sub-class inherits from its super-class o Attributes o Operations o Relationships A sub-class may o Add attributes and operations o Add relationships o Refine (override) inherited operations EmployeeDivision belong to ProfessorCollege

A sample model 다음과 같이 자동차 정비소의 고객관리 및 부품관리에 관한 시스템 을 구축하려고 한다. 고객에 관한 자료는 고객의 이름, 연락처, 자동차 번호, 자동차 종류, 각 자동차별 수리일자, 수리내용, 수리 부품, 수리비, 수리 시 주행 거리 등에 관한 내용이 포함된다. 또한 부품에는 부품별 이름, 규격, 사용되는 자동차 종류, 가격, 부품 공급업체 등의 정보가 있고, 부품 공급업체에 관하여서는 월별 공급 부품, 월별 거래액, 연락처에 관 한 정보가 있어야 한다. 엔진오일 교환과 같이 흔히 발생되는 수리에 대하여서는 미리 소모 되는 부품, 부품 가격, 총 수리비를 미리 계산하여 관리를 한다. 18

Constraints Not all semantics can be described by UML class diagram To make it more expressive, we need C ONSTRAINTS o Key Constraints o Referential Integrity 19

Constraints – Key Constraints Key o A set of attributes that are not allowed to have same values in different instances of a class Key and Primary Key o Every class has at least one key o Class may have more than one key  citizen ID, (name, address) are both keys o Primary Key  One of Primary Key  Basically, any instance of a class is identified by its PK. 20 Employee - name - address - citizen ID - division - phone PK: (name, address)

Constraints – Referential Integrity In relationship (Association, Aggregation, Composition) between two classes A and B, the referenced instance in B from an instance in class A must exist. 21 EmployeeDivision belong to * Ki-Joune Li belong to: Dept. CS ?? Dept. CS How to reference an instance in class B from an instance in class A? A B In C-Lang.  Include Pointer to B in A In DB  Include PK of B in A Foreign Key PK (of B) included in A

Weak Entity Sets Example 22 PlayerFootball team * - name - back number - position Coach - name - level - specialty * - team name - city - sponsor is a key? No, but (back number, team name) is a key  Player is a W EAK E NTITY S ET.  "belong to" is a supporting relationship of "Player"  "Football team" is a supporting class of "Player" Why does it happen ? No, but (back number, team name) is a key  Player is a W EAK E NTITY S ET.  "belong to" is a supporting relationship of "Player"  "Football team" is a supporting class of "Player" Why does it happen ? belong to Observation 1 Observation 2: if football team is also a weak entity set? Observation 3: referential integrity Observation 4: team name - Key

E-R Model ER (Entity-Relationship) o Prior to OMT, an extension of Relation model o Very Similar with UML Class Diagram 23 UML Class DiagramER Model ClassEntity Set AssociationRelationship Aggregation/Composition/ Generalization is-a relationship Attribute isa

ER Model 24 Staff Member Student Courses instructs namedept. phone Receives pre- requisites instructor

Generalization ER Model – isa Relationship 25 Cartoon Movie length title year Weapon isa Murder Voice Star

Composition: isa_component_of ER Model – isa_kind_of and isa_component_of 26 Engine Car Owner Reg. no. Manf. year isa Gear

Differences from UML Class Diagram Cardinality: by arrow type o Many: simple line o One: arrow o example: many employees to one division 27 EmployeeDivision Working for

Differences from UML Class Diagram Multi-way relationship In UML Diagram? 28 HusbandWife Marriage Wedding Hall Year- date No. Attendants