techcode has asked for the wisdom of the Perl Monks concerning the following question:
As I all ready have experience with CGI::Application and HTML::Template and I wanted to use those for creating web applications. Both are simple and can simply be copied into the application folder and things work - no hassle (that's another reason for using it).
Problem I'm now facing is that instead of putting several run modes in one file, I need several files also.
Maybe this would be clear with an example. Say it's an mailing list application. Naturally I want to place all the subscribers administration code in one place, newsletter admin in other place ... where place = module.
Some time ago (like a year passed) I started working on that mailing list application with CGI::App as framework but due to inexperience and lack of time I made it somewhat complicated - well not nice at least. I stopped working on it (~ 85% of it finished) because it was canceled (freelance project) and now I'm thinking to use it as my university project and/or dissertation from e-business ;)
Did anybody used CGI::App for things like that? Maybe some other framework - but for latter as I dint have time to learn new things now.
After thinking for some time I believe I came up with an elegant solution but would like any comments on it.
Basically there in only one index.pl file. That is the entry point to application (or website).
It will be a sort of dispatcher since you could call it with .../index.pl/subscribers/ and itself would require subscribers; (or maybe even several levels deep : index.pl/admin/subscribers for instance) and then folow the rest of plain CGI::App index file (create an object and call run method).
All those modules of application would be child's of some main application module. That main module would have code for authorization/authentication, sessions, reading in config files, connecting to DB ....
And it would be a child of CGI::App (use base 'CGI::Application') or probably that extension for automatic settings of run modes.
Is logic OK here?
I also wonder about few things:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Application for complex web applications?
by esskar (Deacon) on Jul 28, 2005 at 00:45 UTC | |
by cees (Curate) on Jul 28, 2005 at 01:47 UTC | |
by techcode (Hermit) on Jul 28, 2005 at 06:17 UTC | |
|
Re: CGI::Application for complex web applications?
by cees (Curate) on Jul 28, 2005 at 01:40 UTC | |
by techcode (Hermit) on Jul 28, 2005 at 06:33 UTC | |
by cees (Curate) on Jul 28, 2005 at 12:35 UTC | |
by techcode (Hermit) on Jul 28, 2005 at 12:51 UTC | |
by Joost (Canon) on Jul 29, 2005 at 12:39 UTC |