Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relationships Copyright © 1999 Patrick McDermott UC Berkeley Extension Mary Cassatt (1844–1926) Mother and Child against a Green Background.

Similar presentations


Presentation on theme: "Relationships Copyright © 1999 Patrick McDermott UC Berkeley Extension Mary Cassatt (1844–1926) Mother and Child against a Green Background."— Presentation transcript:

1 Relationships Copyright © 1999 Patrick McDermott UC Berkeley Extension pmcdermott@msn.com Mary Cassatt (1844–1926) Mother and Child against a Green Background 1887

2 Connections  CRC Cards : Collaboration  ERD : Relationship  Relational : Foreign Key  Database : Database Key  Programmer : Pointer, Array, Containment  UML : Association  Etc., etc., etc. …: Set, Pairing, Parent/Child, Owner/Members  Some track: Aggregation, Composition

3 Types 1.Existence ∃ –Employee has Dependent Child ren –Auto has AirConditioner 2.Functional –Professor teaches Class –Customer Registers 3.Event –Customer places Order –Auto Accident Happens

4 STUDENT Name Address Telephone Enroll() Party() Flunk() DropOut() TEACHER Name Address Telephone GetHired() GetPaid() Grade() UML Simple RELATIONSHIPS

5 Cardinality 1 to 1 1 to Many Many to Many Use Connector (Not Line) * ** 11 1 Of Hottentots, Russians & Systems Analysts Many: ∞ * M N

6 Association & Relationship ASSOCIATION: The semantic relationship among two or more classifiers that involves connections among their instances. —Rumbaugh, Reference, p. 152 RELATIONSHIP: A reified semantic connection among model elements. Kinds of relationships include association, generalization, flow, and several kinds of dependency. —Rumbaugh, Reference, p. 411 SO: An association is a kind of relationship, one that isn’t any other kind… — Patrick

7 1-to-Many The One side is called 1.“Parent” 2.The Set Owner 3.Root The Many side is called 1.“Child” 2.A “Member” 3.Branch/Leaf Shunchō Autumn Excursion during an Abundant Harvest 1770-90

8 Relationship an Entity? Relationships have no Attributes If you need attributes, it’s an Entity Sometimes called “Junction Class/Record” Sometimes called “Associative Entity” ALL entities with 2 owners are associative –Whether planned or not

9 Kinds of Relationships

10 Object Relativity 1.Generalization/Specialization –IS-A 2.Aggregation –IS-PART-OF 3.Composition –IS-MADE-WITH, IS-MADE-FROM 4.Categories –TYPE, KIND-OF, STATUS 5.Sets –IS-COLLECTION-OF, GROUP-OF

11 Object Examples 1.Generalization/Specialization –A GraduateStudent is a Student 2.Aggregation –A Student is part of a ClassRoster 3.Composition –An Car is made with an Engine 4.Categories –A Sophomore is a type of Student 5.Sets –A Hearing is a collection of Party, Lawyer, Judge, CourtReporter, CourtRoom

12 Types of Relationship IS-A: Generalization, “Inheritance” HAS-A: Aggregation IS-Made-From: Composition –“A form of aggregation with strong ownership and coincident lifetime of parts by the whole.” – Rumbaugh, Reference, p. 226 –I don’t bother distinguishing from Aggregation USES: Association –Default; those that aren’t one of the others

13 Patrick’s Rule A Relationship is a connection of some kind between two objects that is significant to the business or system. Generalizations and aggregations will usually be identified as such, so the generic relationship is usually not believed to be one of those. So we will assume an Association until shown otherwise. The relational model only recognizes Associations, so you won’t be too far off if that’s all you use.

14 K.I.S.S. Keep it Simple, Stupid


Download ppt "Relationships Copyright © 1999 Patrick McDermott UC Berkeley Extension Mary Cassatt (1844–1926) Mother and Child against a Green Background."

Similar presentations


Ads by Google