Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAT376 Modeling Business Requirements using Object Role Modeling (Part 2) LeRoy Tuttle, Jr. Program Manager Microsoft.

Similar presentations


Presentation on theme: "DAT376 Modeling Business Requirements using Object Role Modeling (Part 2) LeRoy Tuttle, Jr. Program Manager Microsoft."— Presentation transcript:

1 DAT376 Modeling Business Requirements using Object Role Modeling (Part 2) LeRoy Tuttle, Jr. Program Manager Microsoft

2 Agenda – Part 2 (DAT376) Visual Studio.NET Enterprise Architect Object Role Modeling Database Design Process Set Theory Review Object Role Modeling Conceptual Schema Design Procedure – – Modeling fact types – Constraining fact types Documenting the Model Documenting the Model Implementing the Model Implementing the Model

3 VSEA Database Design Tools Visio-based (VEA) Visio-based (VEA) – Conceptual data modeling (ORM) – Logical database modeling (Relational, IDEF1X, “ER”) – Physical database modeling (SQL Server, Access, Oracle, DB2, etc.) – Forward and reverse engineering, sync, import/export, reports, etc. Non-Visio Non-Visio – Online physical database design tools – SQL query designer 3

4 The Baseline Database Design Process 4 Modeling business requirements Modeling databases External Conceptual Logical Physical

5 Business Context as a Foundation 5 Universe of Discourse Record Keeping SQL

6 Conceptual Schema Design Procedure (CSDP) Model Relationships 1) Analyze External Information and Create a Conceptual Model 2) Draw a Fact Types and Apply a Population Check 3) Identify Primitive Entity Types and Reformulate Arithmetically Derived Fact Types Derived Fact Types Constrain Relationships 4) Add Uniqueness Constraints and Check Arity of Fact Types 5) Add Mandatory Role Constraints and Check for Logical Derivations Derivations 6) Add Value and Set Constraints, and Create Entity Subtypes 7) Add Frequency, Ring, and Other Constraints

7 CSDP Step 4 Add uniqueness constraints, and check the arity of fact types – Constrain population of fact types – Redundancy is not allowed in a completed conceptual model – Re-express non-elementary facts (N-1 Rule) – Minimal ORM Model!

8 How Internal Uniqueness Constraints Are Symbolized – Arrow-tipped line over role shape – Spans one or more roles 7

9 Examples of internal uniqueness constraints on binary facts 9 For each A, one B For each B, one A, and for each A, one B All of AB is unique

10 Examples of internal uniqueness constraints on ternary facts 10 For each AB, one C For each AC, one B All ABC is unique

11 For every AB, one C, and for every AC, one B Example of overlapping internal uniqueness constraints 11

12 How External Uniqueness Constraints Are Symbolized – Dashed line between roles – Circled ‘U’ in middle of line – Line connects to roles in the constraint 12

13 Example of external uniqueness constraint 13 Instances of BC are unique

14 How Nested Object Types Are Symbolized 15

15 CSDP Step 4 demo demo 16

16 CSDP Step 5 Add mandatory role constraints and check logical derivations – Nullability – Cardinality – Role functional dependency

17 Person … drives … Roles and Object Type Populations 18 … resides in … … works for … A, B A, C B, C Role Population A, B A, C Role Population A, B A, C B, C Role Population Instances of Person in Roles Instances of Person in Roles Union of Role Instances Figure 6.1 Subset of Person Population 1 1 3 3 2 2

18 Independent Object Types A given instance is not required to participate in any roles A given instance is not required to participate in any roles An object type’s population is larger than all of its role’s populations, except for its reference mode An object type’s population is larger than all of its role’s populations, except for its reference mode Role Population DD CC BB AA Object Type Population DD CC BB AA EE Instance Is Not In Role’s Population Instance Is Not In Role’s Population 19

19 How Mandatory Role Constraints Are Symbolized 21

20 How Disjunctive Role Constraints Are Symbolized 23

21 Identifying Entity Types Global means Global means Candidate identifiers Candidate identifiers Primary reference scheme Primary reference scheme 24 Emp num Emp num Employee name Dept 715 720 139 430 715 720 139 430 Adams A Brown T Cantor G Codd EF Adams A Brown T Cantor G Codd EF Computer Science Biochemistry Mathematics Computer Science Biochemistry Mathematics Computer Science 69 62 67 69 62 67 69 301 406 301 507 301 406 301 507 Phone 2345 9642 1221 2911 2345 9642 1221 2911 Ext Access LOC INT LOC INT Tenured/ nontract- expiry Tenured/ nontract- expiry 01/31/95 Tenured 01/31/95 Tenured Location Blg Room 720Brown TBiochemistry624069642LOC01/31/95 Candidate Identifier 1 1 3 3 2 2

22 What Is a Simple Reference Scheme? Definition Definition A simple reference scheme uses instances of a single value type to identify an entity type Characteristics Characteristics – Implied binary fact type – Mandatory role – Simple uniqueness constraint 25

23 How a Internal Compound Reference Scheme is Symbolized 27

24 How a External Compound Reference Scheme is Symbolized 28

25 What Are Transitively Implied Relationships? Definition Definition Object types exhibit a transitive implied relationship when an unbroken chain of comparable relationships is formed spanning a series of object types Characteristics Characteristics – Use in logic and mathematics – Conducts characteristics Examples Examples – If X =Y and Y = Z, then X = Z – If X > Y and Y > Z, then X > Z – If X is like Y and Y is like Z, then X is like Z 30 1 1 3 3 2 2

26 Example of a Logically Derivable Fact Type 32

27 CSDP Step 5 demo demo 34

28 CSDP Step 6 Add value, set, and subtype constraints – Domain of a population – Comparing and contrasting set populations – Specialization of object types

29 Domain of a Population All allowable values All allowable values Values in domain are unique Values in domain are unique Population is not always unique Population is not always unique Population AA BB CC AA ZZ Domain A A B B C C Not in the Domain 36

30 How Value Constraints Are Represented FORML expression FORML expression Person(Name) is an entity object type. Every Person is identified by one distinct Name. The possible values of 'Name' are: 'Jeff', 'Maria', 'Pierre'. Value Constrain t 38

31 Comparing and Contrasting Set Populations Set equality Set equality Subset Subset Set exclusion Set exclusion 39 Set 1Set 2 Set 3Set 4 Set 1Set 3 BBCCAA BBCCAABBCCAA BBAA BB CC AA

32 How Set Constraints Are Represented Set exclusion Set exclusion Set equality Set equality Set subset Set subset 41 Exclusion Constraint Equality Constraint Subset Constraint No Employee that is paid some HourlyWage is paid some Salary. Employee e is paid some Salary if and only if Employee e works as some SalesManager. If Employee e works as some SalesManager then Employee e works as some Salesperson. 1 1 3 3 2 2

33 Specialization of Object Types Subsets of a population Subsets of a population Subsets have distinctive characteristics Subsets have distinctive characteristics – Specialized relationships – Specialized constraints – Start from primitive object types Top-down process Top-down process – Arrows point toward node that was specialized 42 A B G C D F E

34 How Subtype Relationships Are Represented Salesperson is primarily identified by the identification scheme of Employee. Salesperson is a subtype of Employee / Employee is a supertype of Salesperson. Employee is the primary super type of Salesperson. Each Manager is a Salesperson but not every Salesperson is necessarily a Manager. Primary Subtype Relationshi p Secondary Subtype Relationship Subtype Relationshi p 1 1 3 3 2 2 44

35 CSDP Step 6 demo demo 46

36 CSDP Step 7 Add other constraints and perform final checks – Reoccurring domain values – Cardinality – Intra-population relationships – Other constraints

37 Reoccurring Domain Values Each instance must have an allowable value from the population domain Each instance must have an allowable value from the population domain Multiple instances could have the same value Multiple instances could have the same value 48 Population AA AA CC AA CC Domain A A B B C C

38 How Frequency Constraints Are Represented 50 Each Person occurs exactly 2 times or not at all. Each Car, Location combination that occurs, occurs at least 3 and at most 4 times. Frequency Constraint

39 Object Type Intra-Population Relationships Instances of a single object type Instances of a single object type Related groups of instances Related groups of instances – Circularly related groups – Hierarchically related groups – Set relationships between groups 51

40 How Ring Constraints Are Symbolized 53 Ring Constraint Ring Constraint Ring Constraint Ring Constraint Ring Constraint Ring Constraint 1 1 3 3 2 2

41 Purpose Purpose Non-example data Non-example data Irreflexive Ring Constraints Mathematical expression Mathematical expression 54 R is irreflexive iff for all x ~ xRxxxyy Figure 8.X A A B B B B D D C C B B D D E E A A A A AA Constraint Violation! Constraint Violation! No instance is related to itself. 1 1 3 3 2 2

42 Purpose Purpose Non-example data Non-example data Symmetric Ring Constraints Mathematical expression Mathematical expression 55 R is symmetric iff for all x, y xRy  yRx Must have mirror imagexxyy Figure 8.X A A A A A A B B B B B B B B A A A A C C AC Constraint Violation! Constraint Violation! Must have mirror images 1 1 3 3 2 2

43 Purpose Purpose Non-example data Non-example data Asymmetric Ring Constraints Mathematical expression Mathematical expression 56 R is asymmetric iff for all x, y xRy  ~yRxxxyy Figure 8.X A A B B B B C C A A A A C C D D B B A A BA Constraint Violation! Constraint Violation! No opposites 1 1 3 3 2 2

44 R is antisymmetric iff for all x, y x = y & xRy  ~yRx Purpose Purpose Non-example data Non-example data Antisymmetric Ring Constraints Mathematical expression Mathematical expression 57 xxyy Figure 8.X A A B B B B C C A A A A C C D D B B A A BA Constraint Violation! Constraint Violation! AA Constraint Violation! Constraint Violation! No opposites or mirror images / 1 1 3 3 2 2

45 Purpose Purpose Non-example data Non-example data Intransitive Ring Constraints Mathematical expression Mathematical expression 58 R is intransitive iff for all x, y, z xRy & yRz  ~xRzxxyy Figure 8.X A A B B B B C C C C D D D D E E A A E E AE Constraint Violation! Constraint Violation! You cannot skip a generation 1 1 3 3 2 2

46 R is acyclic iff for all x, y, z xRy & yRz  ~zRx Purpose Purpose Non-example data Non-example data Acyclic Ring Constraints Mathematical expression Mathematical expression 59 No ancestor is a descendant xxyy Figure 8.X A A B B B B D D C C E E D D F F F F A A FA Constraint Violation! Constraint Violation! 1 1 3 3 2 2

47 Valid Ring Constraint Combinations 60

48 CSDP Step 7 demo demo 61

49 Documenting the ORM Model demo demo 62

50 Forward & Reverse Engineering 63

51 ORM -> ER -> DDL demo demo 65

52 Concluding Remarks Modeling Business Requirements vs. Modeling a Database Modeling Business Requirements vs. Modeling a Database Use data use cases to seed data models Use data use cases to seed data models Use ORM for information analysis Use ORM for information analysis Use Visual Studio.NET Ent. Architect for conceptual, logical, and physical database modeling Use Visual Studio.NET Ent. Architect for conceptual, logical, and physical database modeling Consider mapping ORM to other logical structures Consider mapping ORM to other logical structures 66

53 Further Resources MOC Course 2090: Modeling Business Requirements to Create a Database Using Visual Studio.NET Enterprise Architect MOC Course 2090: Modeling Business Requirements to Create a Database Using Visual Studio.NET Enterprise Architect http://msdn.microsoft.com/theshow/ (Episode 25) http://msdn.microsoft.com/theshow/ (Episode 25) http://msdn.microsoft.com/theshow/ http://www.msdn.microsoft.com/library/en- us/dv_vstechart/html/vstchvsea_ormoverview.asp http://www.msdn.microsoft.com/library/en- us/dv_vstechart/html/vstchvsea_ormoverview.asp http://www.msdn.microsoft.com/library/en- us/dv_vstechart/html/vstchvsea_ormoverview.asp http://www.msdn.microsoft.com/library/en- us/dv_vstechart/html/vstchvsea_ormoverview.asp (+ articles on use of VEA) (+ articles on use of VEA) http://www.orm.net http://www.orm.net http://www.orm.net http://www.inconcept.com http://www.inconcept.com http://www.inconcept.com http://www.ormcentral.com http://www.ormcentral.com http://www.ormcentral.com Halpin, T.A. 2001, Information Modeling and Relational Databases, Morgan Kaufmann (ISBN 1-55860-672-6) Halpin, T.A. 2001, Information Modeling and Relational Databases, Morgan Kaufmann (ISBN 1-55860-672-6)

54 Don’t forget to complete the on-line Session Feedback form on the Attendee Web site https://web.mseventseurope.com/teched/ https://web.mseventseurope.com/teched/

55 69

56 Backup Slides – Definitions – Guidelines

57 What Are Uniqueness Constraints? Definition Definition A uniqueness constraint prevents duplication of role instances spanned by the constraint Characteristics Characteristics – Prevent fact redundancy – Enforce internal uniqueness – Enforce external uniqueness – Enforce functional dependency 7

58 What Are Nested Object Types? Definition Definition A nested object type is a fact type that is treated as an object type and has an internal structure that is composed of the roles in a fact type’s predicate Characteristics Characteristics – Play a role in another fact type – Used with external constraints between fact types 14

59 What Are Mandatory Role Constraints? Definition Definition A mandatory role constraint forces all instances of an object type to participate in a given role. Reference roles are always mandatory Characteristics Characteristics – Global nature – Implied with functional dependency FORML expression FORML expression 20

60 What Are Disjunctive Mandatory Role Constraints? Definition Definition A disjunctive mandatory role constraint is an inclusive-or constraint that applies to a set of two or more roles Characteristics Characteristics – Multi-role mandatory role constraint – Connected to the same object type – Instance must participate in at least one role FORML expression FORML expression 22

61 What Is a Compound Reference Scheme? Definition Definition A compound reference scheme uses the unique population of a related group of roles to identify an entity type Characteristics Characteristics – Tuple based – Implied mandatory – Uniqueness constraint spans identifying roles 26

62 What Are Logically Derivable Fact Types? Definition Definition The information in a logically derivable fact type is inferred from other fact types. Logically derivable fact types are typically based upon related but separate elementary fact types Characteristics Characteristics – Usually contain hidden information – Not normally shown on diagram – All explicit constraints are normally derivable – Relationships that are transitively implied from other relationships 31

63 What Are Value Constraints? Definition Definition Value constraints limit the population of an object type to a specific domain of allowable values Characteristics Characteristics – Global effect on an object type’s roles – Defined by enumerated list of values – Limit the effect on the Universe of Discourse 37

64 What Are Set Constraints? Definition Definition Set constraints restrict two populations in relation to each other Set constraints restrict two populations in relation to each other Characteristics Characteristics – External – Constrain two roles or tuples – Transfer the impact of constraints 40

65 What Are Entity Subtypes? Definition Definition An entity subtype is an object type that is contained in another object type An entity subtype is an object type that is contained in another object type Characteristics Characteristics – Identified by the primary supertype’s reference scheme – Populations may overlap through implied set constraint – Reuse through inheritance – Subtypes are transitively related – Cumulative relationships and constraints – Based on primitive entity types 43

66 What Are Frequency Constraints? Definition Definition Frequency constraints restrict the number of instances in a population that may share the same domain value Characteristics Characteristics – Specify the cardinality of a role – Apply to a role or tuple – Control the size of the population of a fact type Special types of frequency constraints Special types of frequency constraints – Mandatory role – Uniqueness 49

67 What Are Ring Constraints? Definition Definition Ring constraints control the population of an object type’s roles when the object type has two roles in a fact type Characteristics Characteristics – Common object type – Recursively related role populations – Strong constraint – Six different types 52

68 Guidelines for Selecting a Primary Reference Scheme 29 Where applicable, use reference mode Minimize the number of roles Favor stable, rigid identifiers Be wary of information bearing identifiers Decompose information bearing identifiers Normalize units of measurement

69 Guidelines for Logically Derivable Fact Types 33 Look for other relationships of interest between fact types Look for derivable constraints Look for circular relationship chains Avoid them!

70 Guidelines for Implementing Entity Subtypes 45 Explicitly constrain subtypes to enforce different uses Create a chain of subtypes relating back to a primitive entity type Do not create a subtype unless there is a specific role for it Avoid assigning a subtype its own reference scheme

71 Multimedia: ORM Relational Mapping Process in Microsoft Visio Enterprise Architect Edition 64


Download ppt "DAT376 Modeling Business Requirements using Object Role Modeling (Part 2) LeRoy Tuttle, Jr. Program Manager Microsoft."

Similar presentations


Ads by Google