Object Relationship Discussion Questions

Instructions

Take 30 minutes and answer the following questions together.

Questions

  1. What could be the relationship between these sets of objects? Which object is the "source of truth" in the relationship?
  • Passenger, Ticket, Train
  • Prescription, Doctor, Patient
  • Garage, ParkingSpace
  • NationalPark, Visit, Hiker
  • GasStation, Vechicle, GasPurchase, Owner
  • Topping, Pizza
  • Aritst, Painting, Museum
  • Responsibility, Department, Employee
  1. Come up with 3 has_many/belongs_to relationship.

  2. Come up with 3 has_many to has_many relationships. What could be the object that joins these?