I'm a somewhat novice PHP programmer working on a project for a school
newspaper using OOP. The web application is going to handle viewing,
publishing, etc. As someone who hasn't done much in the way of OOP
design, I'd like to elicit opinions on different ways to put together
the different components of the system.
There are several different general categories of objects that I'll
being creating: Images, Articles, Issues and Volumes. Each will have
different mode. For example, Article has: Archive (preexisting), New,
Clone (copyable vs. movable) and Result (from a database result array
usually for speed during searching).
Additionally, the Image category will have two types: one for staff
members' photos and one to be associated with articles.
Would a factory function approach, like so:
require_once 'lib/image.inc.php';
$image = OpenImage('staff', 'new', $params)
look better to the astute readers than:
require_once 'lib/class.ImageStaffNew.php';
$image = new ImageStaffNew($params);
?
Thx,
-Pingveno