Object Oriented Question
prutwo at onebox.com
Fri Jun 7 10:47:23 EDT 2002
I've decided to clean up the code on my site, and at the same time use
object oriented code.
I have a few ideas in my head, but I really wanted to get some input
from others that have built projects in PHP using OO code.
Here's the problem I'm currently trying to solve (I've simplified it
a bit and left out un-necessary details).
My site is a video game site. Currently, my database has:
A games table which has basic game information for each game (game_id,
title, console, etc)
A reviews table which has game_id (foreign key to games table), review
date, review text, reviewer name and email.
If you look at this URL
you can see a page which shows a list of all the games and the date for
the most recent review for that game.
Currently I'm just doing this with a single SQL query (simple join of
the two tables) and echoing out the results.
I'm trying to envision how to create this page using object oriented
My initial thought was to somehow use a game object, but if I have to
instantiate a game object for every game, this seems like it would have
an enormous amount of overhead and be slow.
How is this usually done on OO projects ?
Am I missing something or would you say that if your data sits in a relational
database and your doing a search or mass listing of data then OO code
is not the way to go.
prutwo at onebox.com | http://www.prusak.com/
More information about the talk