Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages...

27
Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints

Transcript of Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages...

Page 1: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model

1

Conceptual Data Model

PrinciplesGraphical Languages

ModelingConstraints

Page 2: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 2

Principles

• Main approach – object-oriented– Class (entity set, object)

– Association (relationship, relation)

– Data member (attribute, property)

– Instance (entity, occurrence)

Page 3: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 3

Languages

• Entity Relationship model (E-R) (ERM)– Entity set

– Relationship

– Attribute

Page 4: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 4

Languages

• MERISE– Object with occurrences

– Relation

– Propertiy

ENROLL

-NameSUBJECT

IS GIVENTEXTBOOK

-Name-Address

STUDENT

Page 5: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 5

Languages

• Object Role Modeling (ORM)

                        

   

Page 6: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 6

Languages

• Class Diagram– Class with instances

– Association

– Property

+Name+FamilyName+Address

STUDENT

+SubName

SUBJECT+enrolls

*

+is enrolled

*

Page 7: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 7

Conceptual Model

• Goals– Starting from the dictionary and the rules this model tries to reveal

the relations among the data and their interaction

• Example – School

Rules1. Every class has a one and only

one room. 2. Every subject is teaches by only

one teacher.3. Every class is taught a subject a

fixed number of hours.4. Every student can have no more

one mark in every subject.5. The school manages the

timetable and the rating of students and teachers..

Dictionary• Student’s Address,• Subject,• Number of Hours,• Class Name,• Student's Family Name,• Teacher‘s Name,• Mark,• Room Number,• Student’s Name

Page 8: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 8

Concepts

• Class (Entity class, Entity instance)• Association

– Relationship between entity instances

• Attribute – Properties

Page 9: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 9

Defining an Entity Class

• Give it a name (a noun)• Define its attributes• Define the rules

– What belongs to the class?

– How the instances are identified in the class?

• Identifying an instance (Identifier)

1.Attribute2.Attribute

NAME

1.First Name2.Last Name3.Address

STUDENT

Page 10: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 10

Association

• Give a name (a verb)

• Determine the participating classes

• Define the cardinalities

Page 11: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 11

Examples

Page 12: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 12

Identifier of an Association

Page 13: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 13

Cardinalities of an Association

• Cardinalities One to One – 0..1 – 0..1 – Every student

can use one locker

– 0..1 – 1

– 1 – 1 Every student uses a locker and ther are no free lockers

Page 14: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 14

Cardinalities of an Association

• Cardinalities One to Many– 1 – 1..N

– 0..1 – 1..N

– 1 – 0..N

– 0..1 – 0..N

Page 15: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 15

Cardinalities of an Association

• Cardinalities Many to Many– 1..N – 1..N

– 0..N – 1..N

– 0..N – 0..N

Page 16: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 16

Cardinalities of an Association

• Generalization– Minimal cardinality

• Mandatory participation of every instance - 1

• Optionally participation of every instance - 0

– Maximal cardinality• To only one instance of the other class – 1

• To multiple instances of the other class - N

Page 17: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 17

Dimension of an Association

• Number of different classes participating in it

• Multidimensional

-TeacherName

TEACHER

-RoomNo

ROOM

-SubName

SUBJECT-End4

*-End3

*

-End5*

-HourNumber

Make cours

Page 18: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 18

Dimension of an Association

• Multidimensional

Page 19: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 19

Dimension of an Association

• One-dimensional (Reflexive)

Page 20: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 20

Aggregate Associations

• Aggregation

• Composition

Page 21: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 21

Weak Entities

• It is identified through the association

Page 22: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 22

Recommendations

• Don’t use high dimension associations• Be aware not replace classes by associations

Page 23: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 23

Case Study – Management Rules

1. A patient is characterized by:– Unique Number– Name– address– Phone Number

2. General practitioner is characterized by:– Serial Number– Name– Phone Number

3. Each patient is supervised by a GP4. A policlinic is characterized by:

– Name– Address– Phone Number

5. A specialist is characterized by:– Serial Number– Name– Phone Number

6. Each specialist has one or more specialties

7. Each specialist can give consultations in one or more policlinics

8. Each policlinic groups several specialists

9. A patient can make an appointment for a consultation with specialist in a given policlinic, The specialist must work in this policlinic

10. The appointment is for a date that is later than the date of appointment

11. If the consultation does not take place a new appointment must be made no matter what are reasons for the failure

12. Lists of appointment for every specialist are made at the beginning of the day.

13. In the end of every day two reports are made:

– A log of appointment made– A log of consultations done

Page 24: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 24

Case Study - Policlinic

Page 25: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 25

Case Study - Policlinic

Page 26: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 26

Subtypes

• Example – Hardware components order

Page 27: Bogdan Shishedjiev Conceptual Data Model 1 Conceptual Data Model Principles Graphical Languages Modeling Constraints.

Bogdan Shishedjiev Conceptual Data Model 27

Subtypes