phpHoo, Part I
phpHoo, Part I
Abstract
Jonathan Eisenzopf has done a great job showing how easy it can be to create a Yahoo like directory using Perl. perlHoo's elegant design makes for a very useful Web application that adds significant value to a Web site, while maintaining a high degree of simplicity and ease of maintenance.
Laurence Gold has shown us how easy it can be to create the same simplicity and elegance using ASP technology. Although the end results (perlHoo and Yahasp) are models of simplicity, they both have made design decisions that, ultimately, lead to the failure of both of these programs as viable long-term solution to the "Yahoo like directory" goal. This tutorial will address and solve these limitations by using PHP and a relational database. (MySQL). In part I of this tutorial, we'll start out with the basics of using MySQL with PHP, and create a program with the same functionality found in part II of the perlHoo tutorial. We'll also be adding a few new features.
Designing phpHoo
A program's initial design is probably the most critical phase of programming. When you sit down to write a program, you must take the time to design it correctly from the very beginning. Take a look at the design decisions of perlHoo and Yahasp.
The design criteria was as follows:
- Organizes information hierarchically
- Contains information about resources on the Internet
- Allows users to suggest new resources
- Allows editors to modify the directory content
- Is simple to maintain
- Takes less than 1 week to develop
- Exports and imports directory content from/to multiple sources
- Your provider may place a cap on the number of files you are allowed to have. (Quotas) The number of files and directories your programs require now become very important.
- Regardless of how the program is written or what language you use, file system access will always be the single most resource intensive operation in your program. Your program performance will be directly proportional to the number of file system calls it makes. The more files accessed by the program, the slower it gets. Guaranteed. Creating a program designed around file system calls is a recipe for disaster.
- The more useful your directory becomes (more categories with more links), the slower it will be. (More files and directories to search through)
|
Produced by Jonathan
Eisenzopf and
Created: July 20, 1999
Revised: July 20, 1999
URL: https://www.webreference.com/perl/xhoo/php1/