Hudzilla.org - the homepage of Paul Hudson
Contents > Writing PHP > The design process Wish List | Report Bug | About Me ]

19.1.2     Designing the solution

This is NOT the latest copy of this book; click here for the latest version.

Once you have a full grasp of what your users want out of your application, the next goal is to try to plan out how the system should be put together. To begin with, the design should be entirely paper-based - draw sketches of your classes and how they fit together, give functions names and specify where they will be used, and also specify how files should work together.

If your solution involves a database, which it often will, you will likely find it useful to draw up a simple database schema diagram defining each attribute in your tables, as well as the primary and foreign keys. I personally use a very basic schema design, where each table in a database is represented as a table in the diagram with its attributes as physical table rows. Each attribute that is a primary key has a box on its left shaded in, and each attribute that is a foreign key has a box on its right shaded in, with a line connecting it to the table where the key originates.

Once you have your paper design completed - and at this point you may have gone through various iterations as you find problems - you can start doing draft programming. The goal here is to produce a very simple version of your application, a skeleton you might say, that implements the various connectivity between each part of the app. It might be that functions simply output messages such as "Entering function X" and "Exiting function X", which is fine - at this stage the goal is to make sure that the design is, for the most part, correct.

The ease of writing PHP code often makes it relatively straightforward to make fairly advanced prototypes, even to the point where you can end up basing your main application on the final prototype.





<< 19.1.1 Analysing the requirements   19.1.3 Developing the code >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
Be the first to add a comment to this chapter!



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is seven plus ten?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow