Re: New package: DB_DataObject_FormBuilder (was: Re: [PEAR-DEV] Re: DataObjectOnSpeed Sum-Up)

From: Date: Thu, 21 Aug 2003 08:58:53 +0000
Subject: Re: New package: DB_DataObject_FormBuilder (was: Re: [PEAR-DEV] Re: DataObjectOnSpeed Sum-Up)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20224@lists.php.net to get a copy of this message
<wolff@21st.de> wrote : > LIMBOURG Arnaud wrote: > >> Db_DataObject_FormBuilder would make sense. I don't really like the idea >> of putting it into the HTML namespace, imagine a gtk formbuilder or >> whatever is made it could be misleading. Thoughts ? > > Hi all, > > I have now reworked my class (formerly proposed as DataObjectOnSpeed :-)) > according > to the changes suggested by Alan, Arnaud and Lukas. > > Latest voting stats: > - Number of +1´s so far: Three (Yavor, Arnaud, Alan) > - One more positive comment without clear vote (Lukas) > - Two "official" votes still missing > > As I only got 3 +1´s (and no -1) for it with the old name, I´d like to propose > it again as "DB_DataObject_FormBuilder". As such, it will install as > DB/DataObject/FormBuilder.php when packaged. > > It doesn´t extend DB_DataObject anymore, but uses aggregation to do its magic > (thanks > to Arnaud for explaining to me how it´s called that I am doing ;-)). As a > tribute to > that, it requires the very latest version of DB_DataObject to work. > > The new source can be found here: > http://lethe.homelinux.org/FormBuilder.phps > > It´s not yet perfect (ORDER BY on selectboxes doesn´t work yet, minor > inconsistencies > in property naming), but these issues will soon be remedied (I´m working with > it on an > everyday basis now). > > Come on, people... two more votes for ultra-fast rapid prototyping in PEAR, it > can´t be that hard ;-) Markus, Here is a suggestion, I don't know how this could be adapted to your package as it seems to extend DB_DataObject. I would like to add a Builder object to the QuickForm package. Its role would be to build the form using addElement() and addRule() calls. It will use helper objects a bit like it is done already in the Config package. So there could be a HTML_QuickForm_Builder_DataObject that would help Builder build its form based on the structure of a DataObject. Do you get the idea ? Furthermore, taken into consideration that DB_DataObject could be seen as a mix of a Model and a Controller, and QuickForm as a mix between a Controller and a View, I think your package belongs more to QuickForm than to DataObject. Of course, this will need some more work. With Alexey, we have worked a lot on QuickForm lately. We have refactored the validation process to use a new HTML_QuickForm_Validate class that will call HTML_QuickForm_Rule(s) objects, like in the Strategy pattern. We have also worked on a new HTML_QuickForm_Controller class that will handle HTML_QuickForm_Page(s) and HTML_QuickForm_Action(s) objects. This will allow for example Wizard like forms, multipage forms and probably more consistency in the processing of forms. The HTML_QuickForm_Page has a method to build the form upon request, that's where HTML_QuickForm_Builder could be useful. As everything is now extendable, there could also be special HTML_QuickForm_Action(s) and HTML_QuickForm_Rule(s) dedicated to work with DB_DataObjects. I hope you see like me how all this could be integrated together nicely. So before you release anything, I would like to know your opinion on this and whether you would like to help us work on a Builder infrastructure. Bertrand Mansion Mamasam

« previous php.pear.dev (#20224) next »