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

[cgiapp] CGI::App with many apps


I recall seeing some discussion either here or on perlmonks a couple
weeks ago about how to build a website that offers several applications
using CGI::App. However, I cannot remember the substance of what was
discussed, and I'm having trouble finding the thread anywhere.

My question is this: I'm developing a site that will have a Wiki, an
articles database, a mail form, a photo gallery, and possibly other
applications. In the framework I was developing, I was creating some
functions that would generate sidebar content based on the user logged
in -- blocks of links, rss feeds, etc.  These would be present
regardless of the particular application module used.

Now, CGI::Application::Wiki, CGI::App::PhotoGallery, and
CGI::App::MailForm all already exist, and it seems natural that I would
use these. However, what would be a "best practices" method for making
sure each app shares session information and creates the sidebar blocks?

One thought I had was to use a single CGI::App that would use the
'autouse' pragma to load the appropriate CGI::App::SubType based on
runmode and pass off data to that application. Is this a typical way of
doing this? It seems like I'd be creating two (or more) CGI::App
instances, and I wonder how they would play together.

The other idea I had was to have each CGI::App dual-inherit from
CGI::App and my own module (which would handle the session and
generation of the user block content). This seems like it may be easier,
but would end up utilizing several different scripts instead of a single
CGI::App script.

How have others tackled this problem?

-- 
Matthew Weier O'Phinney
http://weierophinney.net/matthew/

---------------------------------------------------------------------
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.