Posted by Jason Barnett on 01/07/05 03:13
>
> Otherwise, I'm curious as to why you're using a large switch, not that
> it's bad inherently IMHO, but there may be a better overall approach.
>
> /jw
I don't know why *he* wants to do it, but one useful example is the MVC
model (google "MVC phppatterns" if you're unfamiliar with the term).
For a given action he can include the class definitions he will need to
perform that action.
Jay, are you using PHP5? Because if you are then I thought of something
else. You can put each class into its own file and define your own
__autoload() function to include a file "just in time". The main
downside to this is if you use someone else's code and they have also
defined their own __autoload() function then you get an error! :(
--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
[Back to original message]
|