Prototypes and how they are used
Posted on 29/3/07 by Tim Koschützki
What are prototypes?
Prototypes are generally used to test an idea in an existing system or before a real system is established. The goal of the prototype is to prove whether the components that will also be in the final system will work together as expected. Think of car manufacturing. Most people use computer models to test things there, without the need to build the final product - the car. We build software prototypes due to the same reasons. On the one hand to fix problems with a lot less hassle and on the other hand to test things in advance. The real essence of prototypes lies in the things you learn building it.
Different forms of prototypes
When people think of software prototypes they think about source code. That is of course true, but only to a certain degree. A prototype in the php world could be a small script that checks whether the database, the php script and the Ajax request will work together as expected. You could also think of a typical Model View Controller setup. Your prototype could be a simple setup of the pattern to check if the controller, the model and the view operate together as expected and whether they are encapsulated as expected. You wouldn't want to build an entire application around your implementation of the Model-View-Controller-pattern only to decide after 6 months that your system is not flexible or scalable enough.
These two examples focus on prototypes being a source code product. However, prototypes need not be source code at all. When you do webdesign and you make a mock up of your website in Photoshop, then that's of course a prototype. When you are making a graphical user interface for another language, like java and not for php, you can use sketches on post-it-sheets, which will ultimately be a prototype of one form or the other too. CakePHP's scaffolding is a good example of prototypes used in php webdevelopment. The scaffolding in php is basically a source code generator - a prototype generator.
The goal of prototypes
Prototypes are required to answer questions only, that's why they are cheaper to produce. They can ignore unimportant details without which the actual product would be senseless. Details which aren't important for you now, but will be for the future users of your application. For example, when you are making a prototype for a website interface you don't need to have correct data. You can even live without that bad user interface when you are making prototypes for your performance tests.
The essence of using prototypes lies in what your learn building them.
What do prototypes investigate?
Put simply, prototypes need to investigate all risky things. Everything nobody has tried before and things that are absolutely critical to the final application. These things could be critical changes made to the database - something that I had to do last week - develop a password encryption system that encrypts all passwords in our current live database. Also I had to change all client code that operates on the passwords, like password resetting functionality.
Besides that, you can use prototypes on everything you feel uncomfortable with. Think of the following:
- Architecture
- New functionality in an existing system
- Buildup and contents of external data
- Tools, frameworks, libraries, etc. from external parties.
- Performance-Issues
- Graphical User Interfaces
- Critical changes to the database
The value of prototypes is not in the source code you produce, but in the things you learn from it. That's the most important thing you need to remember about prototypes.
How to use prototypes
Which details can be ignored with prototypes (most of the time)?
- Correctness - you can use fictive data with prototypes
- Completeness - it could be that the prototype needs to work only with a specific input
- Error-checking - If you don't use the correct path, your prototype might explode. That's okay.
- Documentation - Yes, most prototypes don't need much documentation.
When using prototypes, make sure that everybody involved knows, that you are writing something for the trash bin.