Re: [phplib] HELP: oohforms From: Jeroen Laarhoven (jeroen <email protected>)
Date: 01/03/01

> The original OOH Forms are not that bad as it seems. The basic idea of
> an object oriented approach (central form object that controls form
> element objects) is great but the code is somewhat tricky. It took
> Kristian half a day and me two days to understand how it works. Most
> confusing is marshal_dispatch(). Don't ask my what it does I already
> forgot it.

I am not saying they're bad. I even like the OO design of OOHForms very
much, it's just not easy for people to understand how to use them.
Good (internal) OO design is one thing, but making a good (easy to
understand) component interface is another thing and time is often the
reason to skip the last one.

I also have looked at the marshal_dispatch(), but never figured out how it
worked (not having days to find out :( ). But I learned some nice PHP
futures from the OOHForms code ... great code, a good example if leaning PHP
(I think).

Greetings
Jeroen.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Jeroen Laarhoven, Zwolle, Netherlands
business: jeroen <email protected>, www.webbridge.nl
private: jeroen <email protected>, www.zwolnet.com
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

----- Original Message -----
From: "Ulf Wendel" <uw <email protected>>
To: "Jeroen Laarhoven" <jeroen <email protected>>
Cc: "PHPLIB" <phplib <email protected>>
Sent: Wednesday, January 03, 2001 4:47 PM
Subject: Re: [phplib] HELP: oohforms

>
>
> Jeroen Laarhoven schrieb:
> >
> > > OOHForms is hampered by the fact that it was written by someone else
and
> > > then moved into phplib. Ulf is writing a new Forms library to solve
some
> > > of the interoperability problems and make it a lot cleaner, hopefully
this
> > > will make it more robust too :)
> >
> > OOHForms like FastTemplates origine from Perl wizards and if you tried
Perl
> > you know why you should like PHP ;P and more important why management
likes
> > PHP. One reason is that others can understand, so maintain, your code
:).
>
> The original OOH Forms are not that bad as it seems. The basic idea of
> an object oriented approach (central form object that controls form
> element objects) is great but the code is somewhat tricky. It took
> Kristian half a day and me two days to understand how it works. Most
> confusing is marshal_dispatch(). Don't ask my what it does I already
> forgot it.
>
> The rewrite is not much better as the old code. The scenario is simply
> to complicated for the average PHP beginner to understand it in detail.
> Lots of scripters have problems to understand the concepts of OOP.
> Although I tried to write straight forward and simple code some new
> features make it look complicated. For example you can now set a "name"
> and a "elname" property for every form element. This is helpful with
> radio buttons. A group of radio buttons shares the same HTML name. To
> access one of them you might want to give them a symbolic name that you
> can use in your PHP script.
>
> Another point of confusion might be the new JavaScript routines. This is
> the input the complex version gets:
>
> var _jsname = new form("jsname", ["pass", ["l", 5, 20, "A password must
> have 5 to 20 characters."], "l",
> "numbers", ["l", 3, 100, "Enter at least 3 numbers.", "r",
> "^[0-9]+[\.,]?[0-9]*$", "", "Only numbers are allowed, no other
> characters."], "lr",
> "secret_numbers", ["l", 3, -1, "Enter at least 3 numbers.", "r",
> "^[0-9]+[\.,]?[0-9]*$", "", "Only numbers are allowed."], "lr",
> ...
>
> And here's the JS source...
> http://phplib.netuse.de/cgi/cvsweb.cgi/php-lib/php/form/form_js_simple.js
> http://phplib.netuse.de/cgi/cvsweb.cgi/php-lib/php/form/form_js_complex.js
>
> The with all abstractions it gets more and more complicated the higher
> the level of abstraction gets. For example the assistant/wizard controls
> objects (tpl bridge) that control objects (form) that control objects
> (form_elements).
>
> Don't know if it's this way is really the best way we can go on the form
> issue, but it's the most practicable I have seen.
>
> > I guess his form stuff will be the same, so why no try that first?
>
> Sorry, currently no docs (beside PHPDoc) and no support. It's no longer
> alpha but still beta code.
>
> Ulf
>
> --
> Ulf Wendel, NetUSE AG Siemenswall, D-24107 Kiel
> Tel: +49 431 386 436 00, Fax: +49 431 386 435 99
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>