RE: Suggestions for class design

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay Blanchard <mailto:jay.blanchard@xxxxxxxxxxx>
    on Monday, September 19, 2005 10:40 AM said:

> [snip]
> Where I get tripped up is when I realize I'll need to at some point
> get more than one customer at a time and thus I want to add a method
> called 'get_customers()'.
> [/snip]

> Why, at any point, would you need to get more than one customer?

Good question.

When I need more than one customer is when I'm displaying them all on an
administration page. Maybe a better example class would be Products. One
individual product is displayed on the product's detail page, but in the
search results I'd normally be using the same Product class to display
all the results which forces me to create a 'get_products()' method.

> One
> answer is that all customers or a group of customers will need to be
> updated/edited with the same information. Therefore you need a
> seperate class for multiple customers which could then be extended by
> group. A group of customers is a seperate object. Make sense?

Well, yes I think it does, but what I'm missing is how this new object
interacts with the original one if it does at all. And what would I call
it? 'Multiple_Customers'? Or.. perhaps just 'Customers'! :)

Do I extend the Customer class or is it a stand alone class?



Thanks,
Chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux