Re: Modular: Fusebox & Classes/OOP

From: Date: Sat, 18 Nov 2000 23:39:02 +0000
Subject: Re: Modular: Fusebox & Classes/OOP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-26082@lists.php.net to get a copy of this message
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.). I am of the practice that if it works and you are comfortable with it (and it's not GROSSLY incorrect) then go with it. --Joe On Sat, Nov 18, 2000 at 02:28:22PM -0900, Chris Lott wrote: > I'm coming over to PHP from a lot of Cold Fusion work. In CF I've used the > "Fusebox" architecture (http://www.fusebox.org/), which uses a central index > file to conditionally include files to do the work depending on the "action" > being asked for. I just read about something similar using PHP at > phpbuilder: > http://phpbuilder.com/columns/bill19990831.php3 > > 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; > > where the qry_ and the dsp_ files are files with snippets that to do the > correct database action and display html? > > c > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ "Real programmers don't comment their code. It was hard to write, it should be hard to understand."

« previous php.general (#26082) next »