Re: Modular: Fusebox & Classes/OOP

From: Date: Sat, 18 Nov 2000 23:53:30 +0000
Subject: Re: Modular: Fusebox & Classes/OOP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-26083@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > My question is, is there a good reason to go with developing classes and > > using them conditionally as he does in the article: > > $g = new Gateway_People($homedir); > > > > switch ($boxaction) { > > > > case "viewcustomer": > > $g->viewCustomer($custid); > > break; > > > > case "checkauthentication": > > $g->checkAuthentication($username, $password); > > break; > > > > as opposed to just simply including the files that had the appropriate > > modularized actions: > > > > switch ($boxaction) { > > case "viewcustomer": > > include(qry_customer.php3); > > include(dsp_viewcustomer.php3); > > break; > > case "listcustomers": > > include(qry_customers.php3); > > include(dsp_listcustomer.php3); > > break; > > Remember, programming is like your religion. We all are of the PHP > religion, as many people follow the Christian religion, but of us devoted > to PHP we all practice our religion differently, same as those devoted to > Christianity (or Judaism, Islam, etc., etc.). Let me be quick to add that I am NOT trying to start a flame war, or trolling! I am just curious what the advantages to using the classes would be. At the very least, since I have no OO background, it will be a good learning experience to try it out. But I wanted to make sure that I was at least talking about things that are roughly equivalent. Similarly, it seems like one could accomplish the task with just functions, and calling THOSE conditionally... Primarily, I just seek wisdom regarding what methods result in code that is easiest to maintain/troubleshoot/expand. c -----BEGIN PGP SIGNATURE----- Version: 6.5.8ckt http://irfaiad.virtualave.net/ Comment: PGP Signed for message authentication and verification Comment: KeyID: 0xD68B61E851046CFD iQA/AwUBOhcWctaLYehRBGz9EQKhlACfWgGFWctnd59+VKppexvaZJpTYw0AoPqL y8kV+3BAV7dldoBt2menJHjl =KXru -----END PGP SIGNATURE-----

« previous php.general (#26083) next »