RE: [PHP] Does class length slow down performance
| From: | Jay Blanchard | Date: | Thu, 22 Jul 2010 12:32:16 +0000 |
| Subject: | RE: [PHP] Does class length slow down performance | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307087@lists.php.net to get a copy of this message | ||
[snip]
Thats exacty the point. In my user class I have functions whitch return
object-lists of diffrent users or strings with html-form elements for
managing this user account.
But if I put all these in a helper class I would anyway need to
implement the user object there, because of the other getter functions
(getUserName etc.) and the table-objects.
I always thought this would be less effective, because I have more
instances of objects.
[/snip]
Sounds like a major refactoring is in order, how reusable is your class?
There is not enough room in this e-mail to cover the basic and
intermediate practices of OO design but it sounds like you may need to
re-think your design. Does this class do one thing and only one thing?
Does it do it really well?
Just from what I am reading I see that we have a user class
(getUserName) and that class returns lists of users? It sounds as if to
me that the user class talks not only about a single user, but perhaps
all of the users (object lists of different users).
On the surface that sounds like to classes to me, a user class and a
class to manipulate said users.