[Catalyst] FormHandler -- pro or con?

Benjamin Hitz hitz at genome.stanford.edu
Tue Nov 30 20:55:05 GMT 2010


I suppose my issues were not with HFH itself but rather the DBIC interface.

I had some meh experience with it when I was writing a demo CRUD app (project was eventually dropped for external reasons).
It was fine as far as the basic stuff went, but when I tried to extend it to some complicated forms across DBIC relationships (that did not behave as HFH expected), I ended up having to hack on 
DBIx::Class::ResultSet::RecursiveUpdate.  (This was not a bug per se, but more of an edge case)

That was not particularly fun.  On the other hand if I used FormFu I would have had to essentially write the (recursive) update logic myself anyway.
I checked my notes on this (and it's possible that issued have been fixed since then, this dates from 6/15/2010).

Without too much gory detail:

given:
table colleague has_many colleague_keywords belongs_to keywords
so colleague has_many keywords

* if I set the forms up with a m2m pseudorel (like docs suggest) then when I deleted a keyword from the Form it would instead UPDATE it setting all columns to NULL. 
* If I changed the kw (attempted UPDATE) to a new keyword that didn't exist, then it UPDATES the keyword record, instead of deleting the linking table record and creating a new keyword record.  It also deletes all the linking table entries and recreates them ... which I suppose technically works (but annoys my DBA)
* If I had a colleague and tried to add a keyword (that was already linked to another colleague) it would fail.  Because the form didn't know the primary key of the keyword.
* If I added a brand new keyword to a colleague it would work but did strange things with the linking table.

Probably the schema could have been refactored to work with HFH, but that was not really an option.  There also could have been bugs in my forms, although I was working with GShank a little on this.


Ben



On Nov 30, 2010, at 7:34 AM, will trillich wrote:

> Anybody else *dissing* FormHandler? We've started developing based on FormHandler lately and haven't had troubles... yet?
> 
> 
> On Tue, Nov 30, 2010 at 5:26 AM, Shlomi Fish <shlomif at iglu.org.il> wrote:
> I can recommend *against* HTML-FormHandler.
> 
> For my day job's Perl and Catalyst project, we initially decided to go with
> HTML-FormHandler, only to discover it was buggy, quirky and had severe memory
> leaks. We ended up doing many workarounds and recently made a transition from
> it to HTML-FormFu, which while by no means perfect, is much saner.
> 
> My co-worker "nothingmuch" who has done many of the workarounds can provide
> further comments on it. Recently I had to over-ride a role in the login form
> (for which we need to use HTML-FormHandler due to CatalystX::SimpleLogin) that
> will accept an empty string as the 'action=""' attribute because it only
> placed true values of the attribute there, which ruled out empty strings. But
> I recall many other fun hours debugging HTML-FormHandler.
> 
> Stay away if you can.
> 
> Regards,
> 
>        Shlomi Fish
> 
> --
> -----------------------------------------------------------------
> Shlomi Fish       http://www.shlomifish.org/
> What does "Zionism" mean? - http://shlom.in/def-zionism
> 
> <rindolf> She's a hot chick. But she smokes.
> <go|dfish> She can smoke as long as she's smokin'.
> 
> Please reply to list if it's a mailing list post - http://shlom.in/reply .
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
> 
> 
> 
> -- 
> Failure is not important. How you overcome it, is.
> -- Nick Vujicic
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

--
Ben Hitz 
Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
Stanford University ** hitz at genome.stanford.edu



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101130/4d28eb27/attachment.htm


More information about the Catalyst mailing list