On phpPatterns.com this morning, there's a new pattern posted for all of you out there fed up with having to write something custom each time you need to parse the results of a web form.
The Front Controller pattern handles all requests for a web based application, deciding what happens next, and is usually structured in two parts: a Web handler and a command hierarchy. This allows you to make global changes to the site relatively easy, because your form results are handled by the "web handler". This handler can be easily controlled through the "command hierarchy" (for example, a switch statement), and allows you to adjust your options just as easily. He also suggests that most of the PHP frameworks out there "have it wrong" in the handling of incoming $_GET and $_POST requests.
He goes on to make some other for and against arguments for doing things this way, and it's nice to have both sides of the story. Read up on this interesting topic and see what you think about his conclusions...




