Why bother with this Result Class anyway?
REASON #1
Allows for significant reuse of HTML forms.
One bit of HTML can act as a "search" form, "edit" form, or "add" form.
REASON #2
Optionally adds "next" and "prev" controls to let users
scroll through an arbitrary number of results.
REASON #3
Let's you do very different things depending
on the number of results you get from a query.
* If you get too many results,
you can force the user to further
specifiy the query.
* If you get 10 results you can show a link
to each one.
* If you get one result you can take the user to
a form to edit the result.
* If you don't get any results you can put up a form to add a record.
This class lets you specify the above with a bunch of "rules".
You don't have to worry about all the pages in your site having lots of
custom logic. Instead, they all just specify rules. This also
makes it easier for novice or teams of programmers to get great results.
REASON #3
You don't have to use heavily nested full blown templating system.
You get better separation of content and form because Result Class
templates are different from any other template system
you might happen to be using. |