13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Prototyping<br />

545<br />

n<br />

phpautodoc, available from http://sourceforge.net/projects/phpautodoc/<br />

Again, phpautodoc produces output similar to javadoc.<br />

A good place to look for more applications of this type (<strong>and</strong> <strong>PHP</strong> components in general)<br />

is SourceForge: http://sourceforge.net. SourceForge is primarily used by the<br />

Unix/Linux community, but many projects are available for other platforms.<br />

Prototyping<br />

Prototyping is a development life cycle commonly used for developing web applications.<br />

A prototype is a useful tool for working out customer requirements. Usually, it is a simplified,<br />

partially working version of an application that can be used in discussions with<br />

clients <strong>and</strong> as the basis of the final system. Often, multiple iterations over a prototype<br />

produce the final application.The advantage of this approach is that it lets you work<br />

closely with clients or end users to produce a system that they will be pleased with <strong>and</strong><br />

have some ownership of.<br />

To be able to “knock together” a prototype quickly, you need some particular skills<br />

<strong>and</strong> tools. A component-based approach works well in such situations. If you have access<br />

to a set of preexisting components, both in-house <strong>and</strong> publicly available, you will be able<br />

to do this much more quickly. Another useful tool for rapid development of prototypes<br />

is templates.We look at these tools in the next section.<br />

You will encounter two main problems using a prototyping approach.You need to be<br />

aware of what these problems are so that you can avoid them <strong>and</strong> use this approach to its<br />

maximum potential.<br />

The first problem is that programmers often find it difficult to throw away the code<br />

that they have written for one reason or another. Prototypes are often written quickly,<br />

<strong>and</strong> with the benefit of hindsight, you can see that you have not built a prototype in the<br />

optimal, or even in a near optimal, way. Clunky sections of code can be fixed, but if the<br />

overall structure is wrong, you are in trouble.The problem is that web applications are<br />

often built under enormous time pressure, <strong>and</strong> you might not have time to fix it.You are<br />

then stuck with a poorly designed system that is difficult to maintain.<br />

You can avoid this problem by doing a little planning, as we discussed earlier in this<br />

chapter. Remember, too, that sometimes it is easier to scrap something <strong>and</strong> start again<br />

than to try to fix the problem. Although starting over might seem like something you<br />

don’t have time for, it will often save you a lot of pain later.<br />

The second problem with prototyping is that a system can end up being an eternal<br />

prototype. Every time you think you’re finished, your client suggests some more<br />

improvements or additional functionality or updates to the site.This feature creep can<br />

stop you from ever signing off on a project.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!