Specifications

Prototyping
Prototyping is a development lifecycle commonly used for developing Web applications. A
prototype is a useful tool for working out customer requirements. Usually it is a simplified,
partially working version of an application that can be used in discussion with a client and as
the basis of the final system. Often multiple iterations over a prototype produce the final appli-
cation. The advantage of this approach is that it lets you work closely with a client or end user
to produce a system that they will be pleased with and have some ownership of.
In order to be able to knock together a prototype quickly, you will need some particular
skills and tools. This is where a component based approach works well. If you have access to a
set of preexisting components, both in-house and publicly available, you will be able to do this
much more quickly. Another useful tool for rapid development of prototypes is templates. We
will look at these in the next section.
There are two main problems with using a prototyping approach. You need to be aware of what
these problems are so that you can avoid them and use this approach to its maximum potential.
The first problem is that programmers often find it difficult to throw away the code that they
have written for one reason or another. Prototypes are often written quickly, and with the bene-
fit of hindsight, you can see that you have not built a prototype in the optimal, or even in a
near optimal, way. Clunky sections of code can be fixed, but if the overall structure is wrong,
you are in trouble. The problem is that Web applications are often built under enormous time
pressure and there might not be time to fix it. You are then stuck with a poorly designed sys-
tem that is difficult to maintain.
You can avoid this by doing a little planning as we have discussed earlier in this chapter.
Remember, too, that sometimes it is easier to scrap something and start again than fix it.
Although this might seem like something you dont have time for, it will often save you a lot
of pain later on.
The second problem with prototyping is that a system can end up being an eternal prototype.
Every time you think youre finished, your client will suggest some more improvements or
additional functionality or updates to the site. This feature creep can stop you from ever sign-
ing off on a project.
To avoid this problem, draw up a project plan with a fixed number of iterations, and a date
after which no new functionality can be added without replanning, budgeting, and scheduling.
Separating Logic and Content
You are probably familiar with the idea of using HTML to describe a Web documents
structure, and cascading style sheets (CSS) to describe its appearance. This idea of separating
Using PHP and MySQL for Large Projects
C
HAPTER 22
22
USING PHP AND
MYSQL FOR
LARGE
PROJECTS
471
28 7842 CH22 3/6/01 3:37 PM Page 471