I have read all of the messages in regarding the zygotic
HTML::Forms/FormGen project, and I like the idea.  However, I hope that
the inplementation of such a beast isn't in Perl.  To ensure that a
quality product results, I propose that this library be written in C, and
also in an object-oriented fashion.

What I propose is an object interface to the various form input types, as
well as some higher level functionality that encapsulated what people
frequently do with HTML forms.  For example, I would expect the C
interface to look something like this:

myInput = hfTextInputNew();
myInput->addAttr(myInput, "name", "first_name");
myInput->addAttr(myInput, "value", "Jeffrey");
printf("%s\n", myInput->render(myInput));
myInput->destroy(myInput);


I would expect a similar interface with more methods for a select box,
e.g. mySelect->addOption(mySelect, myOption), and myOption->select.

The Perl wrapper around this library is pretty obvious, and can use the
object-oriented approach also.  We can build upon that with an
enhanced-for-mod_perl interface.

I expect that a C implementation will be ideal from the standpoint of
speed and also memory.  I have taken the liberty of implementing the
neccessary code for the text input type, and the object code is a whopping
2116 bytes, which is mostly base class logic that won't be duplicated for
the other types.  The implementation is also quite fast, rendering 100000
simple text inputs to /dev/null in .78 seconds, without optimizations.

If people think this is the way to go, I will write up a Makefile and
release the code.

-jwb

Reply via email to