I’m into this object-oriented stuff now. I mean, i’m learning how to use it, though i’m yet unsure if i get everything right, but when it comes to being tested, i’ll see. But i’ve met with some unexpected difficulties (as expected).

For example: i have the post object, with the most basic functions (get by id, by date or by string match–the latter two may result in multiple posts stored in one object) and variables (title, subtitle, main body, longer body). I wondered how could i extend this class multiple times. It’s not a problem to extend it once, to add the functionality to handle comments. But again, if i also want to add the functions to handle podcasts, then it could only extend the basic class, thus i’ll get a post object either extended with the functionality of comments or that of podcasts. Then again, i know that i could write it so that podcasts would further extend the comments; but then what would be with those who don’t want to use comments, only podcasts? As of yet, my solution to this was to add an array variable to the base class, which could store the data of the post(s). To that, countless more variables could be added, while new functions just meddle with those. The only problem with this is that, i need to make a separate comment object and manually assign its results to that array in the post object. So, i’d want something like this (yes, i know that this way each object could contain only one post—if you know any better method, i’m open to it):

class post {
  var $title, $subtitle, $date, $edit, $commentable, $body, $long;
  function byId(...);
  function byDate(...);
  function byString(...);
}
class comm extends post {
  var $comments; # array of array(id, date, author, contact, body)
  function byComString(...);
  function byComDate(...);
}
class tags extends post {
  var $tags;
  function byTags(...);
}
class podc extends post {
  var $podc = array('url', 'artist', 'title', 'length', 'bitrate');
  function byPodc(...);
}

I’d want to use the functions and variables available in all extensions, without any being dependent on another.