2018, Fall Pusan National University Ki-Joune Li

Slides:



Advertisements
Similar presentations
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Advertisements

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
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
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.
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,
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.
بسم الله الرحمن الرحيم ” اللهم أنت ربي لا إله إلا أنت خلقتني و أنا عبدك وأنا على عهدك ووعدك ما استطعت ، أعوذ بك من شر ما صنعت ، أبوء لك بنعمتك على و أبوء.
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.
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.
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.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
advanced data modeling
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
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.
Data Modelling 2014, Fall Pusan National University Ki-Joune Li.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
ER Diagrams ● Many different notations are available ● From wikipedia:wikipedia: Entity-relationship modelwikipedia: Entity-relationship model ● How do.
Entity Relationship (E-R) Model
Data Modeling Using the Entity- Relationship (ER) Model
CS422 Principles of Database Systems Entity-Relationship Model
COP Introduction to Database Structures
Unified Modeling Language (UML)
COMP 2710 Software Construction Class Diagrams
Enhanced Entity-Relationship and Object Modeling Objectives
Entity Relationship Model
COP4710 Database Systems E-R Model.
Visit for more Learning Resources
Chapter 5: Structural Modeling
Object-Oriented Modeling with UML
Entity-Relationship Model
Class diagram Description
Chapter 7: Entity-Relationship Model
Entity-Relationship Modelling
Database EER.
Outline of the ER Model By S.Saha
Entity-Relationship Modeling
UML Unified Modelling Language
Object Oriented Analysis and Design
Lec 3: Object-Oriented Data Modeling
Software Engineering Lecture #11.
Module 8 – Database Design Using the E-R Model
2018, Fall Pusan National University Ki-Joune Li
UML Class Diagram.
Data Modeling with Entity Relationship Diagrams (Cont.)
Entity-Relationship Modelling
Unified Modelling Language
Entity Relationship Model
Database Systems Instructor Name: Lecture-9.
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
CS4433 Database Systems E-R Model.
Database EER.
Entity Relation Model Tingting Zhang.
Chapter 2: Entity-Relationship Model
Chapter 6b: Database Design Using the E-R Model
2019, Fall Pusan National University Ki-Joune Li
2019, Fall Pusan National University Ki-Joune Li
Presentation transcript:

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

A brief history - What did Edgar F. Codd do in 1970? 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. He proposed a mathematical model to handle data in an algebraic way with a set of operators. It is called Relational Data Model 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, 1976 More expressive power Everything by means of Entity Set and Relationship

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

What is a Class Diagram? A class diagram describes the types of objects in the system and the various kinds of static relationships that exist among them. 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

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

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

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

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

Associations: Name and Role Association has a name To clarify its meaning The name is represented as a label placed midway along the association line. Usually a verb or a verb phrase. A role is an end of an association where it connects to a class. 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

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

Associations: Notations for Multiplicity Multiplicity Indicators Exactly one 1 Zero or more (unlimited) * (0..*) One or more 1..* Zero or one (optional association) 0..1 Specified range 2..4 Multiple, disjoint ranges 2, 4..6, 8

Association Class Company Person Contract - Salary - Position employer works for employee Company Person 0..* 1..* Contract - Salary - Position

Aggregation A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts. Models a “is a part-part of” relationship. Whole Department 1..1 3..* 40..* 1..10 Chair Faculty Student Staff Part

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

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

Generalization: Inheritance A sub-class inherits from its super-class Attributes Operations Relationships A sub-class may Add attributes and operations Add relationships Refine (override) inherited operations belong to Employee Division Professor College

A sample model We are planning to design a database for university security mana gement with RFID keys. The entrances of university buildings have RFID lock system. Each member of university has a RFID key with her/his ID. There are three types of university members: students, employees, and facult y members Employees have the full access of their department buildings. Students has an access to pre-assigned building and rooms only for allowed time period. It is controlled by each department chair. The access of each faculty office room is allowed only to the faculty, where ea ch faculty member has a faculty office room. We need a list of entrances of each building every day and the list contain (name, type, his/her department, entrance time, building name, door number)

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

Constraints – Key Constraints A set of attributes that are not allowed to have same values in different instances of a class Key and Primary Key Every class has at least one key Class may have more than one key citizen ID, (name, address) are both keys Primary Key One of Primary Key Basically, any instance of a class is identified by its PK. 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. A B belong to Employee Division 1..* 1..1 Ki-Joune Li belong to: Dept. CS ?? Dept. CS In C-Lang.  Include Pointer to B in A How to reference an instance in class B from an instance in class A? In DB  Include PK of B in A Foreign Key PK (of B) included in A

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

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

ER Model Faculty Student Courses name dept. instructor instructs Receives phone Courses pre- requisites

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

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

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

Cardinality Notations of ER-Model

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