+ All Categories
Home > Documents > DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Date post: 12-Jan-2016
Category:
Upload: kolya
View: 39 times
Download: 0 times
Share this document with a friend
Description:
DAT376 Modeling Business Requirements using Object Role Modeling (Part 2). LeRoy Tuttle, Jr. Program Manager Microsoft. Agenda – Part 2 (DAT376). Visual Studio .NET Enterprise Architect Object Role Modeling Database Design Process Set Theory Review Object Role Modeling - PowerPoint PPT Presentation
Popular Tags:
71
DAT376 DAT376 Modeling Business Modeling Business Requirements using Requirements using Object Role Modeling Object Role Modeling (Part 2) (Part 2) LeRoy Tuttle, Jr. LeRoy Tuttle, Jr. Program Manager Program Manager Microsoft Microsoft
Transcript
Page 1: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

DAT376DAT376

Modeling Business Modeling Business Requirements using Object Requirements using Object Role Modeling (Part 2)Role Modeling (Part 2)

LeRoy Tuttle, Jr.LeRoy Tuttle, Jr.

Program ManagerProgram Manager

MicrosoftMicrosoft

Page 2: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Agenda – Part 2Agenda – Part 2(DAT376)(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 typesConstraining fact types

• Documenting the ModelDocumenting the Model• Implementing the ModelImplementing the Model

Page 3: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

VSEA Database Design ToolsVSEA Database Design Tools

• Visio-based (VEA)Visio-based (VEA)– Conceptual data modeling (ORM)Conceptual data modeling (ORM)– Logical database modeling Logical database modeling

(Relational, IDEF1X, “ER”)(Relational, IDEF1X, “ER”)– Physical database modelingPhysical database modeling

(SQL Server, Access, Oracle, DB2, etc.)(SQL Server, Access, Oracle, DB2, etc.)– Forward and reverse engineering, sync, import/export, Forward and reverse engineering, sync, import/export,

reports, etc.reports, etc.

• Non-VisioNon-Visio– Online physical database design toolsOnline physical database design tools– SQL query designerSQL query designer

3

Page 4: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

The Baseline Database Design The Baseline Database Design ProcessProcess

4

Modeling business requirementsModeling business requirements Modeling databasesModeling databases

ExternalExternal ConceptualConceptual LogicalLogical PhysicalPhysical

Page 5: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Business Context as a FoundationBusiness Context as a Foundation

5

Universe of Discourse

Record Keeping

8 am

9 00

10 00

11 00

12 pm

1 00

2 00

3 00

4 00

5 00

Mon Tue Wed Thu Fri

8 am

9 00

10 00

11 00

12 pm

1 00

2 00

3 00

4 00

5 00

Mon Tue Wed Thu Fri

Brownbag Lunch: ORMBrownbag Lunch: ORM

Out of Office: Doctor’s ApptOut of Office: Doctor’s Appt

Off-sitTrainiClass

Off-sitTrainiClass

All-hanQuaterlMeetin

All-hanQuaterlMeetin

Data Modeling Project

Data Modeling Project

Data Modeling Project

Team Meeting

Team Meeting

Manager 1:1

Manager 1:1

Manager 1:1

Data Modeling Project

Data Modeling Project

Data Modeling Project

Monetary Value of Inventory by Percentage

17%

11%

15%

6%10%

22%

11%

8%

Excel Monthly Home Magazine

Ebony Macintosh Apples

Portsmouth Chablis Wine

Fast Golden Raisins

Better Creamed Corn

Denny Toilet Paper

Bird Call Tartar ControlToothpasteMusial Mint Chocolate Bar

Monetary Value of Inventory by Percentage

17%

11%

15%

6%10%

22%

11%

8%

Excel Monthly Home Magazine

Ebony Macintosh Apples

Portsmouth Chablis Wine

Fast Golden Raisins

Better Creamed Corn

Denny Toilet Paper

Bird Call Tartar ControlToothpasteMusial Mint Chocolate Bar

SQLSQL

MonTueTueTueWedThuThuFri

MonTueTueTueWedThuThuFri

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Conf A246101151151101NANA

Conf A246101151151101NANA

1.01.01.02.52.51.55.02.5

1.01.01.02.52.51.55.02.5

Meeting subjectMeeting subjectLocationLocation

RoomRoomDurationDuration

2727

1176262

117NANA

2727

1176262

117NANA

BuildingBuilding

10:309:30

12:001:301:30

10:0011:009:00

10:309:30

12:001:301:30

10:0011:009:00

YesYesNoYesYesNoNoNo

YesYesNoYesYesNoNoNo

RecurringRecurringAppointment timeAppointment time

HourHourWeekdayWeekday

12345678

12345678

IDID

MonTueTueTueWedThuThuFri

MonTueTueTueWedThuThuFri

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Conf A246101151151101NANA

Conf A246101151151101NANA

1.01.01.02.52.51.55.02.5

1.01.01.02.52.51.55.02.5

Meeting subjectMeeting subjectLocationLocation

RoomRoomDurationDuration

2727

1176262

117NANA

2727

1176262

117NANA

BuildingBuilding

10:309:30

12:001:301:30

10:0011:009:00

10:309:30

12:001:301:30

10:0011:009:00

YesYesNoYesYesNoNoNo

YesYesNoYesYesNoNoNo

RecurringRecurringAppointment timeAppointment time

HourHourWeekdayWeekday

12345678

12345678

IDID

MonTueTueTueWedThuThuFri

MonTueTueTueWedThuThuFri

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Conf A246101151151101NANA

Conf A246101151151101NANA

1.01.01.02.52.51.55.02.5

1.01.01.02.52.51.55.02.5

Meeting subjectMeeting subjectLocationLocation

RoomRoomDurationDuration

2727

1176262

117NANA

2727

1176262

117NANA

BuildingBuilding

10:309:30

12:001:301:30

10:0011:009:00

10:309:30

12:001:301:30

10:0011:009:00

YesYesNoYesYesNoNoNo

YesYesNoYesYesNoNoNo

RecurringRecurringAppointment timeAppointment time

HourHourWeekdayWeekday

12345678

12345678

IDID

MonTueTueTueWedThuThuFri

MonTueTueTueWedThuThuFri

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Team MeetingManager 1:1Brownbag Lunch: ORMData Modeling ProjectData Modeling ProjectAll-hands Quarterly MeetingOffsite Training ClassOut of Office: Doctor Apt

Conf A246101151151101NANA

Conf A246101151151101NANA

1.01.01.02.52.51.55.02.5

1.01.01.02.52.51.55.02.5

Meeting subjectMeeting subjectLocationLocation

RoomRoomDurationDuration

2727

1176262

117NANA

2727

1176262

117NANA

BuildingBuilding

10:309:30

12:001:301:30

10:0011:009:00

10:309:30

12:001:301:30

10:0011:009:00

YesYesNoYesYesNoNoNo

YesYesNoYesYesNoNoNo

RecurringRecurringAppointment timeAppointment time

HourHourWeekdayWeekday

12345678

12345678

IDID

Page 6: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Conceptual Schema Design Conceptual Schema Design Procedure (CSDP)Procedure (CSDP)

Model R

elationshipsM

odel Relationships

1) Analyze External Information and Create a Conceptual Model1) Analyze External Information and Create a Conceptual Model

2) Draw a Fact Types and Apply a Population Check2) Draw a Fact Types and Apply a Population Check

3) Identify Primitive Entity Types and Reformulate Arithmetically3) Identify Primitive Entity Types and Reformulate Arithmetically

Derived Fact TypesDerived Fact Types

Constrain R

elationshipsC

onstrain Relationships

4) Add Uniqueness Constraints and Check Arity of Fact Types4) Add Uniqueness Constraints and Check Arity of Fact Types

5) Add Mandatory Role Constraints and Check for Logical5) Add Mandatory Role Constraints and Check for Logical

DerivationsDerivations

6) Add Value and Set Constraints, and Create Entity Subtypes6) Add Value and Set Constraints, and Create Entity Subtypes

7) Add Frequency, Ring, and Other Constraints7) Add Frequency, Ring, and Other Constraints

Page 7: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 4CSDP Step 4Add uniqueness constraints, and Add uniqueness constraints, and check the arity of fact typescheck the arity of fact types

– Constrain population of fact typesConstrain population of fact types– Redundancy is not allowed in a completed Redundancy is not allowed in a completed

conceptual modelconceptual model– Re-express non-elementary facts Re-express non-elementary facts (N-1 Rule)(N-1 Rule)– Minimal ORM Model!Minimal ORM Model!

Page 8: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Internal Uniqueness How Internal Uniqueness Constraints Are SymbolizedConstraints Are Symbolized

– Arrow-tipped line Arrow-tipped line over role shapeover role shape

– Spans one or more Spans one or more rolesroles A

7

Page 9: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Examples of internal uniqueness Examples of internal uniqueness constraints on binary factsconstraints 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 A B

A B

A B

Page 10: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Examples of internal uniqueness Examples of internal uniqueness constraints on ternary factsconstraints on ternary facts

10

For each AB, one C A B C

For each AC, one B

All ABC is unique A B C

A B C

Page 11: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

For every AB, one C,and for every AC, one B

Example of overlapping internal Example of overlapping internal uniqueness constraintsuniqueness constraints

11

A B C

Page 12: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How External Uniqueness How External Uniqueness Constraints Are SymbolizedConstraints Are Symbolized

– Dashed line Dashed line between rolesbetween roles

– Circled ‘U’ in middle Circled ‘U’ in middle of lineof line

– Line connects to Line connects to roles in the roles in the constraintconstraint

12

U

Page 13: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Example of external uniqueness Example of external uniqueness constraintconstraint

13

A

B

C

U

Instances of BC are unique

Page 14: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Nested Object Types Are How Nested Object Types Are SymbolizedSymbolized

15

Location

Time

Subject

"Class"

Student

...at...is used for...

enrolls in

Page 15: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 4CSDP Step 4

demodemo

16

Page 16: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 5CSDP Step 5Add mandatory role constraints and Add mandatory role constraints and check logical derivationscheck logical derivations

– NullabilityNullability– CardinalityCardinality– Role functional dependencyRole functional dependency

Page 17: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Person

… drives …

Roles and Object Type PopulationsRoles and Object Type Populations

18

… resides in …

… works for …

A, B

A, B

A, C

B, C

Role Population

Role Population

A, BA, C Role

PopulationRole

Population

A, BA, CB, C

Role Population

Role Population

Instances ofPersonin Roles

Instances ofPersonin Roles

Union of Role Instances

Union of Role InstancesFigure 6.1

Subset of Person

Population

Subset of Person

Population

Subset of Person

Population

Subset of Person

Population

Subset of Person

Population

Subset of Person

Population

11 3322

Page 18: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Independent Object TypesIndependent Object Types

• A given instance is not required to participate in any rolesA given instance is not required to participate in any roles• An object type’s population is larger than all of its role’s An object type’s population is larger than all of its role’s

populations, except for its reference modepopulations, except for its reference mode

Role Population

DDDD

CCCC

BBBB

AAAA

Object Type Population

DDDD

CCCC

BBBB

AAAA

EEEEInstance Is

Not In Role’sPopulation

Instance Is Not In Role’sPopulation

19

Page 19: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Mandatory Role Constraints How Mandatory Role Constraints Are SymbolizedAre Symbolized

21

Person Name

is identified by

Page 20: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Disjunctive Role Constraints How Disjunctive Role Constraints Are SymbolizedAre Symbolized

23

Employee

MobilePhone

Office

has

works in

Page 21: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Identifying Entity TypesIdentifying Entity Types• Global meansGlobal means• Candidate identifiersCandidate identifiers• Primary reference schemePrimary reference scheme

24

EmpnumEmpnum

Employee name

Employee name

DeptDept

715720139430

715720139430

Adams ABrown TCantor GCodd EF

Adams ABrown TCantor GCodd EF

Computer ScienceBiochemistryMathematicsComputer Science

Computer ScienceBiochemistryMathematicsComputer Science

69626769

69626769

301406301507

301406301507

PhonePhone

2345964212212911

2345964212212911

ExtExt AccessAccess

LOCLOCINTINT

LOCLOCINTINT

Tenured/nontract-

expiry

Tenured/nontract-

expiry

01/31/9501/31/95TenuredTenured

01/31/9501/31/95TenuredTenured

LocationLocation

BlgBlg RoomRoom

720 Brown T Biochemistry 62 406 9642 LOC 01/31/95

Candidate Identifier

Candidate Identifier

Candidate Identifier

Candidate Identifier

Candidate Identifier

Candidate Identifier

Candidate Identifier

Candidate Identifier

11 3322

Page 22: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Is a Simple Reference What Is a Simple Reference Scheme?Scheme?

• DefinitionDefinitionA A simple reference schemesimple reference scheme uses instances of uses instances of

a single value type to identify an entity type a single value type to identify an entity type

• CharacteristicsCharacteristics– Implied binary fact typeImplied binary fact type– Mandatory roleMandatory role– Simple uniqueness constraintSimple uniqueness constraint

25

Person(Name)

Person NameP

is identified by

Page 23: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Person(Num)

FirstName

LastName

Date

PlaceOfBirthP

...has...and...and was born...and was born in...

How a Internal Compound How a Internal Compound Reference Scheme is SymbolizedReference Scheme is Symbolized

27

Page 24: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Person

LastName

FirstName

PlaceOfBirth

Date

has

has

was born on

was born in

How a External Compound How a External Compound Reference Scheme is SymbolizedReference Scheme is Symbolized

28

Page 25: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Transitively Implied What Are Transitively Implied Relationships?Relationships?

• DefinitionDefinitionObject types exhibit a Object types exhibit a transitive implied transitive implied

relationshiprelationship when an unbroken chain of when an unbroken chain of comparable relationships is formed comparable relationships is formed spanning a series of object typesspanning a series of object types

• CharacteristicsCharacteristics– Use in logic and mathematicsUse in logic and mathematics– Conducts characteristicsConducts characteristics

• ExamplesExamples– If X =Y and Y = Z, then X = ZIf X =Y and Y = Z, then X = Z– If X > Y and Y > Z, then X > ZIf X > Y and Y > Z, then X > Z– If X is like Y and Y is like Z, then X is like ZIf X is like Y and Y is like Z, then X is like Z

3011 3322

Page 26: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Example of a Logically Derivable Example of a Logically Derivable Fact TypeFact Type

32

City

State

Country

is in is in

is in

Page 27: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 5CSDP Step 5

demodemo

34

Page 28: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 6CSDP Step 6Add value, set, and subtype constraintsAdd value, set, and subtype constraints

– Domain of a populationDomain of a population– Comparing and contrasting set populationsComparing and contrasting set populations– Specialization of object typesSpecialization of object types

Page 29: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Domain of a PopulationDomain of a Population

• All allowable valuesAll allowable values• Values in domain are uniqueValues in domain are unique• Population is not always uniquePopulation is not always unique

Population

AAAA

BBBB

CCCC

AAAA

ZZZZ

Domain

AA

BB

CC

Not in the

Domain

36

Page 30: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Value Constraints Are How Value Constraints Are RepresentedRepresented• FORML expressionFORML 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

Person(Name)

Car

{ 'Jeff', 'Maria', 'Pierre' }

drives

38

Page 31: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Comparing and Contrasting Set Comparing and Contrasting Set PopulationsPopulations

• Set equalitySet equality

• SubsetSubset

• Set exclusionSet exclusion

39

Set 1 Set 2

Set 3 Set 4

Set 1 Set 3

BBBB CCCCAAAA

BBBB CCCCAAAA BBBB CCCCAAAA

BBBBAAAA

BBBB CCCCAAAA

Page 32: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Set Constraints Are How Set Constraints Are RepresentedRepresented• Set exclusionSet exclusion

• Set equalitySet equality

• Set subsetSet subset

41

Employee

Salesperson

Salary

HourlyWage

SalesManager

is paid

is paid

works as

works as

Exclusion Constraint

EqualityConstraint

SubsetConstraint

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.

11 3322

Page 33: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Specialization of Object TypesSpecialization of Object Types

• Subsets of a populationSubsets of a population• Subsets have distinctive Subsets have distinctive

characteristicscharacteristics– Specialized relationshipsSpecialized relationships– Specialized constraintsSpecialized constraints– Start from primitive object typesStart from primitive object types

• Top-down processTop-down process– Arrows point toward node that Arrows point toward node that

was specializedwas specialized

42

AA

BB

GG

CC

DD

FF

EE

Page 34: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Subtype Relationships Are How Subtype Relationships Are RepresentedRepresented

Employee

Accountant Salesperson

Manager

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

Relationship

Secondary Subtype

Relationship

SubtypeRelationshi

p

11 3322

44

Page 35: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 6CSDP Step 6

demodemo

46

Page 36: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 7CSDP Step 7Add other constraints and perform Add other constraints and perform final checksfinal checks

– Reoccurring domain valuesReoccurring domain values– CardinalityCardinality– Intra-population relationshipsIntra-population relationships– Other constraintsOther constraints

Page 37: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Reoccurring Domain ValuesReoccurring Domain Values

• Each instance must have an allowable value from Each instance must have an allowable value from the population domainthe population domain

• Multiple instances could have the same valueMultiple instances could have the same value

48

Population

AAAA

AAAA

CCCC

AAAA

CCCC

Domain

AA

BB

CC

Page 38: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Frequency Constraints Are How Frequency Constraints Are RepresentedRepresented

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.

Person

Car

Location

2 3..4

...drives...to...

Frequency Constraint

Page 39: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Object Type Intra-Population Object Type Intra-Population RelationshipsRelationships• Instances of a single object typeInstances of a single object type• Related groups of instancesRelated groups of instances

– Circularly related groupsCircularly related groups– Hierarchically related groupsHierarchically related groups– Set relationships between groupsSet relationships between groups

51

Page 40: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

How Ring Constraints Are How Ring Constraints Are SymbolizedSymbolized

53

RingConstraint

RingConstraint

RingConstraint

RingConstraint

RingConstraint

RingConstraint

11 3322

Page 41: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

• PurposePurpose• Non-example dataNon-example data

Irreflexive Ring ConstraintsIrreflexive Ring Constraints

• Mathematical expressionMathematical expression

54

R is irreflexive iff for all x

~ xRx

xxxx yyyyFigure 8.XAA BB

BB DD

CC BB

DD EE

AA AAA AConstraintViolation!

ConstraintViolation!

No instance is related to itself.No instance is related to itself.No instance is related to itself.No instance is related to itself.

11 3322

Page 42: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

• PurposePurpose• Non-example dataNon-example data

Symmetric Ring ConstraintsSymmetric Ring Constraints

• Mathematical expressionMathematical expression

55

R is symmetric iff for all x, yxRy yRx

Must have mirror image

xxxx yyyyFigure 8.XAA AA

AA BB

BB BB

BB AA

AA CCA CConstraintViolation!

ConstraintViolation!

Must have mirror imagesMust have mirror imagesMust have mirror imagesMust have mirror images

11 3322

Page 43: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

• PurposePurpose• Non-example dataNon-example data

Asymmetric Ring ConstraintsAsymmetric Ring Constraints

• Mathematical expressionMathematical expression

56

R is asymmetric iff for all x, yxRy ~yRx

xxxx yyyyFigure 8.XAA BB

BB CC

AA AA

CC DD

BB AAB AConstraintViolation!

ConstraintViolation!

No oppositesNo oppositesNo oppositesNo opposites

11 3322

Page 44: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

R is antisymmetric iff for all x, y

x = y & xRy ~yRx

• PurposePurpose• Non-example dataNon-example data

Antisymmetric Ring ConstraintsAntisymmetric Ring Constraints

• Mathematical expressionMathematical expression

57

xxxx yyyyFigure 8.XAA BB

BB CC

AA AA

CC DD

BB AAB AConstraintViolation!

ConstraintViolation!

A AConstraintViolation!

ConstraintViolation!

No opposites or mirror imagesNo opposites or mirror imagesNo opposites or mirror imagesNo opposites or mirror images

/

11 3322

Page 45: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

• PurposePurpose• Non-example dataNon-example data

Intransitive Ring ConstraintsIntransitive Ring Constraints

• Mathematical expressionMathematical expression

58

R is intransitive iff for all x, y, z

xRy & yRz ~xRz

xxxx yyyyFigure 8.XAA BB

BB CC

CC DD

DD EE

AA EEA EConstraintViolation!

ConstraintViolation!

You cannot skip a generationYou cannot skip a generationYou cannot skip a generationYou cannot skip a generation

11 3322

Page 46: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

R is acyclic iff for all x, y, z

xRy & yRz ~zRx

• PurposePurpose• Non-example dataNon-example data

Acyclic Ring ConstraintsAcyclic Ring Constraints

• Mathematical expressionMathematical expression

59

No ancestor is a descendantNo ancestor is a descendantNo ancestor is a descendantNo ancestor is a descendant

xxxx yyyyFigure 8.XAA BB

BB DD

CC EE

DD FF

FF AAF AConstraintViolation!

ConstraintViolation!

11 3322

Page 47: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Valid Ring Constraint Valid Ring Constraint CombinationsCombinations

60

oa n s oir

oa s

osym

oa c

oit

Page 48: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

CSDP Step 7CSDP Step 7

demodemo

61

Page 49: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Documenting the Documenting the ORM ModelORM Model

demodemo

62

Page 50: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Forward & Reverse EngineeringForward & Reverse Engineering

ORM sourcemodel 1

ORM sourcemodel 2

ER sourcemodel 1

LogicalDatabase

ModelProject 1

LogicalDatabase

ModelProject 2

...

...

Build Generate

Database

DDLcreatescript

Database

Update DDLupdatescript

63

Page 51: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

ORM -> ER -> DDLORM -> ER -> DDL

demodemo

65

Page 52: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Concluding RemarksConcluding Remarks

• Modeling Business Requirements vs. Modeling Modeling Business Requirements vs. Modeling a Databasea Database

• Use data use cases to seed Use data use cases to seed data modelsdata models

• Use ORM for information analysisUse ORM for information analysis• Use Visual Studio .NET Ent. Architect for Use Visual Studio .NET Ent. Architect for

conceptual, logical, and physical database modelingconceptual, logical, and physical database modeling• Consider mapping ORM to other Consider mapping ORM to other

logical structureslogical structures

66

Page 53: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Further ResourcesFurther Resources

• MOC Course 2090: Modeling Business Requirements to MOC Course 2090: Modeling Business Requirements to Create a Database Using Visual Studio .NET Enterprise Create a Database Using Visual Studio .NET Enterprise ArchitectArchitect

• http://http://msdn.microsoft.com/theshowmsdn.microsoft.com/theshow// (Episode 25) (Episode 25) • http://www.msdn.microsoft.com/library/en-us/dv_vstechart/htmhttp://www.msdn.microsoft.com/library/en-us/dv_vstechart/htm

l/vstchvsea_ormoverview.aspl/vstchvsea_ormoverview.asp

(+ articles on use of VEA)(+ articles on use of VEA)• http://www.orm.nethttp://www.orm.net• http://www.inconcept.comhttp://www.inconcept.com• http://www.ormcentral.comhttp://www.ormcentral.com• Halpin, T.A. 2001, Halpin, T.A. 2001, Information Modeling and Relational Information Modeling and Relational

DatabasesDatabases, Morgan Kaufmann (ISBN 1-55860-672-6), Morgan Kaufmann (ISBN 1-55860-672-6)

Page 54: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Don’t forget to complete the Don’t forget to complete the on-line Session Feedback form on-line Session Feedback form on the Attendee Web siteon the Attendee Web site

https://web.mseventseurope.com/teched/https://web.mseventseurope.com/teched/

Page 55: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

69

Page 56: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Backup SlidesBackup Slides

– DefinitionsDefinitions– GuidelinesGuidelines

Page 57: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Uniqueness What Are Uniqueness Constraints?Constraints?

• DefinitionDefinitionA A uniqueness constraintuniqueness constraint prevents duplication prevents duplication

of role instances spanned by the constraintof role instances spanned by the constraint

• CharacteristicsCharacteristics– Prevent fact redundancyPrevent fact redundancy– Enforce internal uniquenessEnforce internal uniqueness– Enforce external uniquenessEnforce external uniqueness– Enforce functional dependencyEnforce functional dependency

7

Page 58: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Nested Object Types?What Are Nested Object Types?

• DefinitionDefinitionA nested object type is a fact type that is treated A nested object type is a fact type that is treated

as an object type and has an internal structure as an object type and has an internal structure that is composed of the roles in a fact type’s that is composed of the roles in a fact type’s predicatepredicate

• CharacteristicsCharacteristics– Play a role in another fact typePlay a role in another fact type– Used with external constraints between fact typesUsed with external constraints between fact types

14

Page 59: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Mandatory Role What Are Mandatory Role Constraints?Constraints?

• DefinitionDefinitionA A mandatory role constraintmandatory role constraint forces all instances forces all instances

of an object type to participate in a given role. of an object type to participate in a given role. Reference roles are always mandatoryReference roles are always mandatory

• CharacteristicsCharacteristics– Global natureGlobal nature– Implied with functional dependencyImplied with functional dependency

• FORML expressionFORML expression

20

Page 60: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Disjunctive Mandatory What Are Disjunctive Mandatory Role Constraints?Role Constraints?• DefinitionDefinition

A A disjunctive mandatory role constraintdisjunctive mandatory role constraint is an is an inclusive-or constraint that applies to a set inclusive-or constraint that applies to a set of two or more rolesof two or more roles

• CharacteristicsCharacteristics– Multi-role mandatory role constraintMulti-role mandatory role constraint– Connected to the same object typeConnected to the same object type– Instance must participate in at least one roleInstance must participate in at least one role

• FORML expressionFORML expression

22

Page 61: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Is a Compound Reference What Is a Compound Reference Scheme?Scheme?• DefinitionDefinition

A A compound reference schemecompound reference scheme uses the uses the unique population of a related group of roles unique population of a related group of roles to identify an entity typeto identify an entity type

• CharacteristicsCharacteristics– Tuple basedTuple based– Implied mandatoryImplied mandatory– Uniqueness constraint spans identifying rolesUniqueness constraint spans identifying roles

26

Page 62: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Logically Derivable Fact What Are Logically Derivable Fact Types?Types?

• DefinitionDefinitionThe information in a The information in a logically derivable fact typelogically derivable fact type is inferred is inferred

from other fact types. Logically derivable fact types are from other fact types. Logically derivable fact types are typically based upon related but separate elementary fact typically based upon related but separate elementary fact typestypes

• CharacteristicsCharacteristics– Usually contain hidden informationUsually contain hidden information– Not normally shown on diagramNot normally shown on diagram– All explicit constraints are normally derivableAll explicit constraints are normally derivable– Relationships that are transitively implied from other Relationships that are transitively implied from other

relationships relationships

31

Page 63: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Value Constraints?What Are Value Constraints?

• DefinitionDefinitionValue constraintsValue constraints limit the population of an limit the population of an

object type to a specific domain of allowable object type to a specific domain of allowable values values

• CharacteristicsCharacteristics– Global effect on an object type’s rolesGlobal effect on an object type’s roles– Defined by enumerated list of valuesDefined by enumerated list of values– Limit the effect on the Universe of DiscourseLimit the effect on the Universe of Discourse

37

Page 64: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Set Constraints?What Are Set Constraints?

• DefinitionDefinition Set constraintsSet constraints restrict two populations in restrict two populations in

relation to each otherrelation to each other

• CharacteristicsCharacteristics– ExternalExternal– Constrain two roles or tuplesConstrain two roles or tuples– Transfer the impact of constraintsTransfer the impact of constraints

40

Page 65: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Entity Subtypes?What Are Entity Subtypes?

• DefinitionDefinition An An entity subtypeentity subtype is an object type that is contained is an object type that is contained

in another object typein another object type• CharacteristicsCharacteristics

– Identified by the primary supertype’s reference schemeIdentified by the primary supertype’s reference scheme– Populations may overlap through implied set constraintPopulations may overlap through implied set constraint– Reuse through inheritanceReuse through inheritance– Subtypes are transitively relatedSubtypes are transitively related– Cumulative relationships and constraintsCumulative relationships and constraints– Based on primitive entity typesBased on primitive entity types

43

Page 66: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Frequency Constraints?What Are Frequency Constraints?

• DefinitionDefinitionFrequency constraints Frequency constraints restrict the number of restrict the number of

instances in a population that may share the instances in a population that may share the same domain valuesame domain value

• CharacteristicsCharacteristics– Specify the cardinality of a roleSpecify the cardinality of a role– Apply to a role or tupleApply to a role or tuple– Control the size of the population of a fact typeControl the size of the population of a fact type

• Special types of frequency constraintsSpecial types of frequency constraints– Mandatory role Mandatory role – UniquenessUniqueness

49

Page 67: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

What Are Ring Constraints?What Are Ring Constraints?

• DefinitionDefinitionRing constraintsRing constraints control the population of an control the population of an

object type’s roles when the object type has two object type’s roles when the object type has two roles in a fact typeroles in a fact type

• CharacteristicsCharacteristics– Common object typeCommon object type– Recursively related role populationsRecursively related role populations– Strong constraintStrong constraint– Six different typesSix different types

52

Page 68: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Guidelines for Selecting a Primary Guidelines for Selecting a Primary Reference SchemeReference Scheme

29

Where applicable, use reference modeWhere applicable, use reference mode

Minimize the number of rolesMinimize the number of roles

Favor stable, rigid identifiersFavor stable, rigid identifiers

Be wary of information bearing identifiersBe wary of information bearing identifiers

Decompose information bearing identifiersDecompose information bearing identifiers

Normalize units of measurementNormalize units of measurement

Page 69: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Guidelines for Logically Derivable Guidelines for Logically Derivable Fact TypesFact Types

33

Look for other relationships of interest between fact typesLook for other relationships of interest between fact types

Look for derivable constraintsLook for derivable constraints

Look for circular relationship chainsLook for circular relationship chains

Avoid them!Avoid them!

Page 70: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

Guidelines for Implementing Guidelines for Implementing Entity SubtypesEntity Subtypes

45

Explicitly constrain subtypes to enforce different usesExplicitly constrain subtypes to enforce different uses

Create a chain of subtypes relating back to a primitive entity typeCreate a chain of subtypes relating back to a primitive entity type

Do not create a subtype unless there is a specific role for itDo not create a subtype unless there is a specific role for it

Avoid assigning a subtype its own reference schemeAvoid assigning a subtype its own reference scheme

Page 71: DAT376 Modeling Business Requirements using Object Role Modeling (Part 2)

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

Meeting

PK Meeting ID

FK1 MeetingOrganizer proposesPerson IDSubject

FK2 Hosted physically LocationBuildingFK2 Hosted physically Location RoomNumberFK3 Hosted electronically Online URLFK4 Hosted telephonically Teleconference TelephoneNumberFK4 Hosted telephonically Teleconference AccessCode

Reoccurs

Location

PK,FK1 BuildingPK RoomNumber

FK2,U1 Venue ID

Building

PK Building

Timeslot

PK StartTimeTimePK StopTimeTime

Duration

Teleconference

PK TelephoneNumberPK AccessCode

FK1,U1 Venue ID

Person

PK Person ID

Online

PK Online URL

AccessCodeFK1,U1 Venue ID

Appointment spans Timeslot

PK,FK1 Appointment IDPK,FK2 StartTimeTimePK,FK2 StopTimeTime

Venue

PK Venue ID

AttendeeCapacity

Person invites Person Meeting

PK,FK1 Person invitesPerson IDPK,FK2,U1 Invites Person toPerson ID

FK3,U1 Meeting ID

VenueManager approves use Venue Meeting

PK,FK2 Venue IDPK,FK1 Meeting ID

FK2 Person ID

VenueManager owns Venue

PK,FK1 Person IDPK,FK2 Venue ID

Appointment used reoccuring Meeting

PK,FK1 Appointment IDPK,FK2 Meeting ID

Appointment

PK Appointment ID

FK1 Used onetime Meeting ID

Person Status Meeting

PK,FK1 Person IDPK,FK1 Meeting ID

Status

Meeting(ID)

MeetingOrganizer

Subject

Time(TimeValue)

Duration+

Location !

Online !(URL)

Teleconference !

Appointment !(ID)

Person !(ID)

Venue !(ID)

AttendeeCapacity+

Building !(Number)

RoomNumber

AccessCode

TelephoneNumber

"Timeslot"

(ac,it)

>=2

VenueManager

has **

Pis related

spans

is in

has

has

has

hasis used by reoccuring

is used by one-time

reoccurs

is hosted electronically at

is hosted telephonically at

is hosted physically at

...invites...to...

proposes

has

...approves use of...for...

owns has

Status

{ 'Decline', 'Accept', 'Tentative' }

...has...for...

64


Recommended