Re: oo question
| From: | Torsten Roehr | Date: | Mon, 19 Apr 2004 17:46:02 +0000 |
| Subject: | Re: oo question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183830@lists.php.net to get a copy of this message | ||
>so although the second class has a lot more code in it, it also allows
>me to change what happens behinds the scenes (i.e. variable names) more
>easily. for example the customer will always have a "first_name" but i
>may not always want to use $fname to represent it within the class.
>this revised class, in my limited experience, seems to be much more oo
>than my current class.
>seeing as how this email turned out longer than i had planned i will
>only be asking one question at this time. in fact i can't even remember
>what my second question was anyway. :)
>any and all comments are appreciated!
>thanks,
>chris.
Hi Chris,
the second approach is definitely much, much better and the right way to go.
But what exactly is your QUESTION?
One personal suggestion: you could directly put the code from
initialize_customer() into the constructor.
Regards,
Torsten Roehr