Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and a 3-tier architecture? 1

Status
Not open for further replies.

balance

Programmer
Feb 5, 2002
52
CA
Here is a different one for everyone.

What would it take to consider PHP using mySQL, a 3 tier architecture? I don't want to use a COM object in implementing a system deployed through a web host. What options are out there? Would referencing classes in another file work (that is really what we do with a COM .dll)? Is it possible to build something similar to COM in PHP? Do we need to? I need some arguements and options, I am taking on someone who is in love with Microsoft technologies %-(.

Thanks for any help
 
"Using PHP to Develop Three-Tier Architecture Applications" (Parts I and II):


The above tutorial presents a complete PHP templating solution as an application layer of its own. If this approach is done properly, I say it's perfectly fair game to be considered a 3-tier app. That's just one example. A multiple-tier application is largely a conceptual thing. I mean, you could easily say that you have 3 tiers with any PHP app, because you have a database, PHP to handle decision-making, and a webserver to handle the presentation. Or, you could divide your application inside PHP in several layers, such as (1) central includes, which hold base classes, (2) specialized includes for different major areas of your application, and then the "front end" PHP scripts, which draw in the HTML template libraries and integrate them with the data output. This is 3 tiers accomplished completely inside PHP. (Hey, if you can have a multiple-tier application inside a single environment such as Java, why not PHP?)

If you have a database such as PostgreSQL that handles complex stored procedures, then you can add another tier to your application.

Or, if you wanted to really please those who say the above analogy is "no fair", you could easily hook PHP into a multiple-tier Java application. So then you could have your database, Java handling the "business decisions", and PHP handling the user interaction.

Or, for certain types of web apps, you could say you have the database, the PHP code for logic, and a DHTML/Javascript front end handling the user interaction. Don't laugh at the thought of Javascript as a programming environment until you have read "Javascript Objects" (Wrox press). And with Mozilla and XUL/Javascript, you could take this a step further. -------------------------------------------

"Calculus is just the meaningless manipulation of higher symbols"
                          -unknown F student
 
rycamor,

Thanks for the great help and for saying exactly what I wanted to hear.

Cheers,

AJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top