Clean design issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pingveno

    #1

    Clean design issue

    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('staf f', 'new', $params)

    look better to the astute readers than:

    require_once 'lib/class.ImageStaf fNew.php';
    $image = new ImageStaffNew($ params);

    ?

    Thx,
    -Pingveno
Working...