Connecting Tech Pros Worldwide Help | Site Map

Clean design issue

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:55 PM
Pingveno
Guest
 
Posts: n/a
Default 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('staff', 'new', $params)

look better to the astute readers than:

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

?

Thx,
-Pingveno

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.