Jesse,

Af few weeks ago, I asked a question about a snazzy way to do a fill
in form in one line

return 
$self->fill_form($self->tt_process({}),$self->dbh->selectrow_hashref("SELECT
* from menus WHERE id = ?",{},$id));

Since this uses dbh directly, in Krang to do something similar does
that mean you would make a method in a Krang module that was simply a
wrapper to this call ? I guess the advantage to that would be that
many other places could call this method with common results, instead
of having to change many sql statements and risking errrors.

Jeff.

On 12/18/05, Jesse Erlbaum <[EMAIL PROTECTED]> wrote:
> Hi Rob --
>
> > I would break each of them up into functional areas. My rule of thumb
> > is never more than 12, rarely more than 6, preferably 4 or less.
> > Anything more and I'm trying to do too much in the controller and
> > should be offloading into business objects.
>
>
> Just regarding the last part, "business objects" --
>
> At the moment you do so, it is rarely clear that you've crossed the line
> into "too much" territory.  (You know when you're deep into wrong path,
> but by then it's too late.)  On the Krang CMS project we were able to
> define a hard rule about what was appropriate in CGI-App modules, and
> what was not.  That rule:
>
>   CGI::Application modules are prohibited from having or using DBI
> database handles.
>
> This rule was simple because no subjective judgment was needed.  You
> either did or did not have a $dbh.  As the primary side effect, this
> rule provided a natural separation between object/business modules and
> front-end CGI/UI modules.  If you needed to access or modify data, you
> had to go through another module.  This had the effect of orienting all
> the developers towards the philosophy of separation.  The project
> benefited greatly as a result.
>
> TTYL,
>
> -Jesse-
>
>
> --
>
> Jesse Erlbaum
> The Erlbaum Group
> [EMAIL PROTECTED]
> Phone: 212-684-6161
> Fax: 212-684-6226
>
>
> ---------------------------------------------------------------------
> Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
>               http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Jeff MacDonald
http://www.halifaxbudolife.ca
http://www.nintai.ca

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to