"Joel Kitching" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What generic class name would be appropriate in this case? I just
> can't see how I would link the two together. Also, they would have to
> use fairly generic variables names if I were to do this. Like using
> the vari
Hello!
Another option would be to have a generic "List" class that displays
items in a list.
Both your Album and Photo class should implement a method like
"getNextItem" or the PHP5-native iterator methods so the List class can
iterate over a class assigned to it without knowing what it is.
Look correct from my point of view...
class Portfolio {
var $portfolioID ;
var $albums = array () ;
function Portfolio ( $newID ) {
$this->portfolioID = $newID ;
}
function addAlbum ( $album ) {
$this->albums[] = $album ;
}
function getAlbum () {
return curren
"Joel Kitching" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Mon, 28 Jun 2004 13:41:19 -0500, Jay Blanchard
> <[EMAIL PROTECTED]> wrote:
> > If you are going to duplicate code why not just create a generic class
> > with the code that would be duplicated and then extend the clas
On Mon, 28 Jun 2004 13:41:19 -0500, Jay Blanchard
<[EMAIL PROTECTED]> wrote:
> If you are going to duplicate code why not just create a generic class
> with the code that would be duplicated and then extend the class as
> required?
>
What generic class name would be appropriate in this case? I j
[snip]
So my question is, should I just duplicate the code in each class
(Portfolio and Album), or is there a better way of organizing all of
this?
[/snip]
If you are going to duplicate code why not just create a generic class
with the code that would be duplicated and then extend the class as
req
6 matches
Mail list logo