[PEPr] Comment on Structures::Structures_Form
| From: | Justin Patrin | Date: | Fri, 24 Mar 2006 16:25:52 +0000 |
| Subject: | [PEPr] Comment on Structures::Structures_Form | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41968@lists.php.net to get a copy of this message | ||
Justin Patrin (http://pear.php.net/user/justinpatrin) has commented on the proposal for
Structures::Structures_Form.
Comment:
Exceptions thrown should be extended from PEAR_Exception
(Structures_Form_Exception and possibly sub-classes to classify types of
exceptions, although codes are also good for this). This, of course, means
you'll have to move the require_once of PEAR/Exception.php to the top of
your code. ;-)
I'm also a bit disappointed with the separation of Structures_Form and the
GTK2 components and I don't really like that the elements "can't" be
extended from a base class. This is going to cause a lot of extra
duplicated code when it comes to elements. I understand the need for this
with GTK2, but it's causing duplicate code in a few ways.
First of all, the elements should be independant of the rendering
structure so that you can add types of elements to the form without
deciding on a renderer. This would allow the same form object to render in
many formats. In addition, this will pull the common code needed for
dealing with elements into these classes, leaving the rendering elements
leaner.
I'm aware that this is no easy task as it's something I've been working
with for FormBuilder2. However, it's not trying to be a form package, it's
just trying to generalize the way that it handles forms...
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=377
--
Sent by PEPr, the automatic proposal system at http://pear.php.net