OOP: How would you set up an Artist, Album & Song relationship in OOP

qtwqwc

New Member
I understand the basics of inheritance but this one is confusing me. How would you go about saying:
  • An album object has one or more artist objects
  • An album object has one or more song objects
My current code only will only allow one song per object:\[code\]class Song extends Album{}class Album extends Artist{}\[/code\]I'm sure i'm overlooking something important. Any thoughts?I'm doing this in PHP
 
Back
Top