I'm at about the same stage of "figuring things out" as you are, I'd recommend looking into
C::A::P::Dispatch, it can basically parse your query string, to know which module handles which runmode, combine that with AutoRunmodes and you get a pretty cool setup. Jeff. On 12/18/05, RA Jones <[EMAIL PROTECTED]> wrote: > Reading the thread on 'Good practices: how many run modes in an app' it > is obvious my current application under development is going way over > the 'recommended' upper limit of rm's. I know I need to break it into > smaller units based around functionality, but how? > > At the moment my main application module is invoked either through an > instance script (eg myapp.cgi) or via an embedded Apache handler - it's > designed to work with both. As soon as I think of splitting the module > into smaller units I'm not sure I know how to proceed. How's this: > > MyApp::Base contains all the CGI::Application override methods like > cgiapp_init, setup, cgiapp_prerun, template_pre_process, etc but no > run-modes (except perhaps session/authentication/authorisation methods). > It uses base CGI::Application. > > MyApp::Function_1 contains all the run-modes related to function_1 (eg > edit records) and uses base MyApp::Base ie it inherits cgiapp_init, > setup, etc from the MyAPpp::Base module (or should we use @ISA here?). > Other MyApp:Function_ modules are setup as needed. But the question is > how to call these modules - do they each have to have their own instance > script pointing to them (eg myapp_function_1.cgi, myapp_function_2.cgi, > etc), and an embedded Apache handler so they can run under mod_perl? One > instance script per module? If so I have to change all the templates to > point to any one of many mini-applications - in fact what we get is a > host of mini-apps running under the umbrella of a larger whole. This > seems a little complicated, almost defeating the object of breaking the > application into smaller units. > > Or is this all completely wide of the mark? I think an example of an > application broken into multiple parts would be very helpful for me at > this stage. > -- > Richard Jones > Leeds, UK > mailto:[EMAIL PROTECTED] > > --------------------------------------------------------------------- > Web Archive: http://www.mail-archive.com/[email protected]/ > 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/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
