1 / 34

Modeling Relationships

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.

tyra
Download Presentation

Modeling Relationships

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Modeling Relationships Farrokh Alemi, Ph.D.

  2. 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.

  3. 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)

  4. 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." 

  5. 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. 

  6. 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 

  7. Some Relationships Suggest New Entities • Hierarchical • Many to many relationships

  8. 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.

  9. An Example of Generalization & Specialization

  10. An Example of Generalization & Specialization

  11. Hiearchy May Simplify Data Structures • Specializations of the more general data class Person • Oftentimes, introducing a subtype hierarchy can simplify the information model

  12. 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. 

  13. Rules for Identifying Hierarchies

  14. Confusion • 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

  15. Steps for Identifying a Hierarchy • Shared attributes • Discriminator attribute • Entity linkages at the super type level

  16. Step two: Discriminator

  17. Example

  18. Step Three: Linkages at Super Entity Level • Reduces unnecessary linkages • Simpler to read • Easier to implement

  19. Advantages of Hierarchies Stabilize  the overall model with respect to new requirements.

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

  21. Insert a new entity in the  hierarchy • Include the new entity in the discriminator attribute • Check that all sub entities are appropriately named

  22. New Data Structure

  23. Check Sub Entities The first issue is whether the sub entity is distinct form other entities 

  24. Check Super Entity • Do the attributes in the super entity apply equally well to the new sub entity

  25. 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

  26. Many to Many Relationships

  27. Another Example

  28. Patient Clinician Association

  29. Association Class Simplifies • Resolve  all many-to-many linkages • A simpler way of capturing and tracking many relationships

  30. 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

  31. Portions of Information Model

  32. 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. 

  33. Revised Information Model

  34. 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.

More Related