I'm kind of new to OOP, so bear with me here... I have a portfolio which contains albums. These albums contain photos. So it would be natural to declare the classes:
Portfolio Album Photo It seems to me that none of these classes have the "is a" relationship, and therefore can not be "extended" from each other. The reason I wish to do this, is because listing albums and listing photos use almost exactly the same code. i.e. // The constructor would automatically fill in the album's variables from the database. $album = new Album($album_id); // This would print out the HTML for the list of photos. $album->list_photos(); ... or the same thing with "Portfolio," which would list the albums. The only thing that's different is the links to which the anchors are pointing, and the content. (Thumbnails.) So my question is, should I just duplicate the code in each class (Portfolio and Album), or is there a better way of organizing all of this? -- Joel Kitching http://midgardmanga.keenspace.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php