For illustration purposes, let's say that I am creating a simple blog application and have a Blog class:
Class Blog(){
__constructor(){
connectToDatabase();
}
}
Class BlogPost($id) extends Blog {
public $title;
public $body;
etc.
}
The blogpost class can be created as an object that represents a specific blog post. But when I want to list all the records in the database, I have to place this function somewhere else.
I could put it in the Blog class, but suggested that I have a lot of functions that don't apply to a particular object, where should it be placed?
Or maybe I'm writing a line to a log file. It seems silly to have a "logfile" class containing one function that writes the passed string to a text file.
Utility(), , util_commenting(), util_archives()? ?