22
1 Introduction to modeling WS 2015/16 ER modelling Slides for this part are based on Chapters 8 from Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition (ISBN: 978-0-12-373568-3), published by Morgan Kaufmann Publishers.

Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

1

Introduction to modelingWS 2015/16

ER modellingSlides for this part are based on

Chapters 8 from Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition (ISBN: 978-0-12-373568-3),

published by Morgan Kaufmann Publishers.

Page 2: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

2

Where are we?

# Title Date1 Introduction 07.10.2015

2 General concepts 21.10.2015

3 ORM modeling 04.11.2015

4 Relational modeling 18.11.2015

5 ER modeling 02.12.2015

6 OO modeling 16.12.2015

7 Services and process modeling 13.01.2016

10 Exam 27.01.2016

Page 3: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

3

Intro

• ER models business domains in terms of entities that have attributes and participate in relationships

• Very popular data modeling approach for databases• Originally proposed by Peter Chen in 1976

Material on this slide based on Ch 8.1 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 4: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

4

Barker notation

• Building blocks: entities, relationships, and attributes

• Attributes:– “#” indicates that the attribute is, or is a component of, the primary identifier of

the entity type– “*” indicates that the attribute is mandatory– “°” indicates the attribute is optional

• Relationships are restricted to binaries– A solid half-line denotes a mandatory role, and a dotted half-line indicates an

optional role– Crow’s foot notation is used for cardinality; intuitively indicates “many”, by its

many “toes”; the absence of a crow’s foot intuitively indicates “one”

Material on this slide based on Ch 8.2 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 5: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

5

Barker notation (cont’)

• ER diagram (a) and its equivalent to ORM (b)

• Verbalization: Each A (must | may) be R (one and only one B | one or more B-plural-form)

– Each Employee must be an occupier of one and only one Room; Each Room may be occupied by one or more Employees.

Material on this slide based on Ch 8.2 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 6: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

6

Equivalent Barker ER and ORM diagrams

Material on this slide based on Ch 8.2 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 7: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

7

Equivalent Barker ER and ORM diagrams

Material on this slide based on Ch 8.2 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 8: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

8

Composite identification in Barker ER

• A bar “|” across one end of a relationship indicates that the relationship is a component of the primary identifier for the entity type at that end.

• Composite identification in (a) Barker ER and (b) ORM

Material on this slide based on Ch 8.2 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 9: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

9

Other constraints in Barker ER

• Exclusion constraints are shown as an “exclusive arc” connected to the roles with a small dot or circle

• Mutually exclusive and disjunctively mandatory constraints uses the exclusive arc, but each role is shown as mandatory (solid line)

Material on this slide based on Ch 8.2 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 10: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

10

Other constraints in Barker ER

• Subtyping is depicted with a version of Euler diagrams.

Material on this slide based on Ch 8.2 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 11: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

11

Barker ER notation – summary

Material on this slide based on Ch 8.3 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 12: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

12

Barker ER notation – summary

Material on this slide based on Ch 8.3 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 13: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

13

Information Engineering (IE) Notation

• Different versions exist, no single standard• Supported by many data modeling tools very popular notation for

database design

Material on this slide based on Ch 8.3 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 14: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

14

Equivalent constraint patterns in IE and ORM

Material on this slide based on Ch 8.3 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 15: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

15

Equivalent constraint patterns in IE and ORM

Material on this slide based on Ch 8.3 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 16: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

16

IDEF1X notation overview

Material on this slide based on Ch 8.4 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 17: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

17

ERmap – Mapping from ORM to ER

Material on this slide based on Ch 8.5 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 18: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

18

Some examples of ERmap steps

Step 1.1

Step 1.2

Step 1.3

Step 2

Step 3

Step 4

Material on this slide based on Ch 8.5 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

Page 19: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

19

Some remarks on ER vs ORM

• In general, attribute-free approaches have advantages for conceptual analysis, including simplicity, stability, and ease of validation

• Attributes allow compact diagrams that directly represent the implementation data structures (e.g., tables or classes).

– Compact yet still high level view of the business domain– But whether some fact ends up in the design as an attribute should not be a conceptual issue

• Attribute-free approaches offer greater semantic stability– If one models a feature as an attribute and finds out later that something needs to record about it, it needs to

be remodel as an entity type or relationship because attributes can’t have attributes or participate in relationships

• ORM models facilitate validation by both verbalization and population– Attributes make it awkward to use sample data populations

• ER models are further removed from natural language and may be harder for the domain expert to conceptualize

– Ternary vs binary relationships: an n-ary association may always be transformed into binaries, however this may introduce an object type that appears artificial to the domain expert

• In general ER notations are less expressive than ORM for capturing constraints or business rules

Page 20: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

20

Resources

• Chapter 8 in Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition (ISBN: 978-0-12-373568-3), published by Morgan Kaufmann Publishers.

• Richard Barker, Case*Method: Entity Relationship Modelling (1990), published by Addison-Wesley Professional

• Tools:– RISE Editor: http://www.risetobloome.com/– Calligra Flow: https://www.calligra.org/flow/– Dia: https://wiki.gnome.org/action/show/Apps/Dia

Page 21: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

21

Next lecture

# Title Date1 Introduction 07.10.2015

2 General concepts 21.10.2015

3 ORM modeling 04.11.2015

4 Relational modeling 18.11.2015

5 ER modeling 02.12.2015

6 OO modeling 16.12.2015

7 Services and process modeling 13.01.2016

10 Exam 27.01.2016

Page 22: Web 2.0 and RESTful Web Services - sti-innsbruck.at · 1 Introduction to modeling. WS 2015/16. ER modelling. Slides for this part are based on Chapters 8 from . Halpin, T. & Morgan,

22

Questions?