[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Structuring my C::A


Jason A. Crome wrote:

Hello again,

Thanks for the help I received on my earlier email :)  Very much
appreciated.  I'm hoping again for some insight into a problem I'm having.

My C::A has two modes: search and query.  Each mode produces a web page
consists of one or more "tabs".  In search mode (for example), each tab
collects some information from the user, then combines that data into a
database query.

I think this is a very common model, and am curious too how others handle this.

The run modes in C::A rock :)  But what I can't figure out is a good way
(using C::A methods) to generate data for whatever tab a user selects.  In
my newbieness, I've only been able to determine a way using some if
statements.


[snip source code]

I get some use out of C::A's run modes, but this doesn't seem as if it makes
the best use of what C::A has to offer.  Problem is that I can't wrap my
head around another way of doing it.

The way I would like to do it, is to have a module for the tabs that would also inherit from C::A. It would be driven by a second runmode parameter (say, 'tab'), and return its output back to the main App.
	
so in search you would do something like

	use App::Tab;
	return App::Tab->new()->run;

I can imagine doing the same modularity for the actions, if that is worth it. Now that I think of it, this sort of resembles the way you'd do traditional GUI programming. The main app has some menu items that call up dialogs/screens, which are selfcontained modules. Of course, this requires that the $ENV{OUTPUT_RETURN_ONLY} be wrapped in a method, so that you can turn it on and off on a per object basis. ;^)

Thanks for whatever advice can be offered!


Rhesa

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.