By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

Clean design issue

P: n/a
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 = OpenImage('staff', 'new', $params)

look better to the astute readers than:

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


Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.