Modular: Fusebox & Classes/OOP
| From: | Chris Lott | Date: | Sat, 18 Nov 2000 23:28:22 +0000 |
| Subject: | Modular: Fusebox & Classes/OOP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26080@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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
-----BEGIN PGP SIGNATURE-----
Version: 6.5.8ckt http://irfaiad.virtualave.net/
Comment: PGP Signed for message authentication and verification
Comment: KeyID: 0xD68B61E851046CFD
iQA/AwUBOhcQkdaLYehRBGz9EQJ94gCg8VUIBnGOFc+TMcyZlkTs6lNkGnQAn1HN
mS3KBSvCITme/7lnL/S5puIm
=ETDX
-----END PGP SIGNATURE-----