Modeling relationships
1 / 34

Modeling Relationships - PowerPoint PPT Presentation

  • Updated On :

Modeling Relationships . Farrokh Alemi, Ph.D. Definition of Hierarchy. A collection of super and sub entities. A super entity is the broadest definition of several sub entities. A sub entity is an entity that inherits its relationship from another entity. . Definition of Relationship.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Modeling Relationships' - tyra

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Modeling relationships l.jpg

Modeling Relationships

Farrokh Alemi, Ph.D.

Definition of hierarchy l.jpg
Definition of Hierarchy

  • A collection of super and sub entities.

    • A super entity is the broadest definition of several sub entities.

    • A sub entity is an entity that inherits its relationship from another entity.

Definition of relationship l.jpg
Definition of Relationship

  • Relationship describes the link between two entities

  • Different words for the same idea

    • At the conceptual level (e.g. entity and their relationships)

    • At the physical level (tables, data classes and linkages)

Relationships are identified through sentences l.jpg
Relationships Are Identified Through Sentences

  • A sentence containing the names of the two entities and a verb phrase in between. 

    • Verb phrases:  "has," "contains," "visits," "prescribes," "travels with," etc.

    • The two entities "Patient" and "Clinician" can be made into a sentence such as "A patient visits a clinician." 

Relationships revealed l.jpg
Relationships Revealed

  • Is one of the entities a look up table used to provide menu items for an attribute of the other entity. 

  • Is one of the entities a subcategory to another. 

  • Do two entities share an attribute. 

Relationships documentation l.jpg
Relationships Documentation

  • The name of first entity

  • The name of second entity

  • The verb phrase describing the relationship

  • The cardinality of the relationship

    • one to one, one to many or many to many 

Some relationships suggest new entities l.jpg
Some Relationships Suggest New Entities

  • Hierarchical

  • Many to many relationships

Generalization specialization l.jpg
Generalization & Specialization

  • The process of abstracting from  narrowly scoped terms into terms of broader scope is a generalization process.  

  • Starting with a general term and narrowing its scope is a specialization process.

Hiearchy may simplify data structures l.jpg
Hiearchy May Simplify Data Structures

  • Specializations of the more general data class Person

  • Oftentimes, introducing a subtype hierarchy can simplify the information model

Rules for identifying hierarchies l.jpg
Rules for Identifying Hierarchies

  • Super-type is the broadest entity,  should have all the attributes that are shared across the sub-entities.  

  • Each sub-entity should have an attribute that makes it different from other  entities. 

    • The attributes should be mutually  exclusive. 

Confusion l.jpg

  • It may not be possible for sub types to unambiguously reside in one  and only one of the subtypes specified in the hierarchy. 

    • Refine further

    • If confusing, do not do it

Steps for identifying a hierarchy l.jpg
Steps for Identifying a Hierarchy

  • Shared attributes

  • Discriminator attribute

  • Entity linkages at the super type level

Step three linkages at super entity level l.jpg
Step Three: Linkages at Super Entity Level

  • Reduces unnecessary linkages

    • Simpler to read

    • Easier to implement

Advantages of hierarchies l.jpg

Advantages of Hierarchies

Stabilize  the overall model with respect to new requirements.

An example l.jpg

An example

New Requirement: “Patient of record” becomes inactive but the system does not purge it

Insert a new entity in the hierarchy l.jpg
Insert a new entity in the  hierarchy

  • Include the new entity in the discriminator attribute

  • Check that all sub entities are appropriately named

Check sub entities l.jpg

Check Sub Entities

The first issue is whether the sub entity is distinct form other entities 

Check super entity l.jpg
Check Super Entity

  • Do the attributes in the super entity apply equally well to the new sub entity

Check discriminator l.jpg

Check Discriminator

The third issue is whether the discriminator attribute in  the super-entity applies to all sub types

The importance of  good entity and attribute definitions

Association class simplifies l.jpg
Association Class Simplifies

  • Resolve  all many-to-many linkages

  • A simpler way of capturing and tracking many relationships

Self referral l.jpg
Self Referral

  • A Person to Person Association

  • A self referring relationship is found in the same way as all relationships are found by making a sentence containing the name of the entity and a verb phrase

New requirements l.jpg
New Requirements

  • Some of the facilities may have  multiple postal addresses.

  • One way to incorporate the new requirement would be to add  multiple attributes to each one of the entities. 

Take home lessons l.jpg
Take Home Lessons

  • We saw that scenarios focus on decisions

  • Scenarios contain use cases which reveal the information exchange

  • Exchanges are used to specify fields.