entity / relationship diagrams
DESCRIPTION
Entity / Relationship Diagrams. Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with classes (I.e., first class citizens) - not necessarily binary. Product. address. buys. name. - PowerPoint PPT PresentationTRANSCRIPT
Entity / Relationship Diagrams
Objects entitiesClasses entity sets
Attributes are like in ODL.
Relationships: like in ODL except
- not associated with classes (I.e., first class citizens)
- not necessarily binary
Product
address
buys
address name ssn
Person
buys
makes
employs
CompanyProduct
name category
stockprice
name
price
Multi-way Relationships
Purchase
How do we model a purchase relationship between buyers,products and stores?
Product
Person
Store
Roles in Relationships
Purchase
What if we need an entity set twice in one relationship?
Product
Person
Store
salesperson buyer
Roles in Relationships
Purchase
Product
Person
Store
salesperson buyer
Note the multiplicity of the relationships: we cannot express all possibilities
Attributes on Relationships
Purchase
Product
Person
Store
date
Design Principles
PurchaseProduct Person
What’s wrong?
President PersonCountry
Moral: be faithful!
What’s Wrong?
Purchase
Product
Store
date
personpersonAddr
Moral: don’t talk too much.
What’s Wrong?
Purchase
Product
Person
Store
dateDates
Moral: don’t complicate life more than it already is.
Do we really need 3-way relationships?
Purchase
Person
Store
Product
StoreOf
ProductOf
BuyerOf
Moral: Find a nice way to say things.