> 
> Okay, so let me see if I'm understanding this with a short example:
> You have three Actions, ACtionA, ActionB, and ActionC.
> You have three screens ScreenA, ScreenB, ScreenC.
> OVerall, the Screen and the Action have no relation.  (there 
> is some loose
> connection, but abstractly, they are unrelated).
> 
> If so, it sounds like you have problem with the single Run mode param.
> (Probably the most FA of the FAQs)


Yeah, that's pretty much it.

> 
> Would something like this solve it?
> (Simple version)
> Have your run modes do the appropriate Action, based on the 
> runmode.  Each
> run mode returns $self->EvaluateAction() which is a routine 
> that looks at
> another param and returns the appropriate screen (or 
> HTML::Template call)


OK, this would work, but wouldn't EvaluateAction() just be a big 
if-then-else tree? (sort of what I am trying to avoid with cgiapp)

> 
> (More complicated but more flexible version)
> Create a subclass of CGI::App.  (I'll call it Vaughn::App).  In this
> subclass, override run() to act much as it does now, but with first an
> action routine, then a screen routine.  You can add functions 
> to act as
> the various functions that control run-mode do to control the screen
> routine.  Any of your Application modules will be subclasses of this
> class.
> 


I tried something like this, but aborted it.  I was trying to 
handle the action routine in the subclass run() and then call 
run() in the base class to handle the screen.  As you suggest it, 
I should override run() in the base class altogether.  Hmm ...

> 
> Hope this helps.
> 


Yes, this does help, and I certainly appreciate it.  

As a final question, given that "a problem with the single Run 
mode param is probably the most FA of the FAQs" are there any 
proposals being considered to support something like a list 
of run mode params in the future?  Controlling the output would 
obviously be an issue, as it is for me currently.  
I'm still not sure I understand why it is necessary for run() 
to do the print.  Since it returns $output(), wouldn't it be 
more flexible to let the programmer decide what to actually do 
with the output that run() produces?

Thanks again,
Elizabeth

 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to