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

[cgiapp] Re: feedback on CGI::Application::Dispatch


On 2006-02-07, Viacheslav Sheveliov <suppressed> wrote:
>
> "Component Auto-Discover"(c) can't be done by default due to nature 
> ofdispatch table storage method. 

Viacheslav,

I believe this line could be described as providing "Component
Auto-Discovery":

 ':app/:rm'  => {},

It means that the first part of PATH_INFO will be used as the module name, and the 
the next part as the run mode. 

So, if an application module is considered a component, it can certainly
be discovered automatically by the dispatcher because no changes are
needed to to the dispatch table to find it. 

> One need to write dispatch table in 
> instance script  or config file to "explain" rules for dispatcher. Making 
> more complicated things on dispatching stage is awkward, cause we are faced 
> with chicken-and-egg -like problem. Instance script or dispatcher becomes 
> applications by themselves, although they are bootstrappers only. I prefer 
> to load C::A - derived modules first and let them to do really 
> application-specific things.

I like that CGI::Application::Dispatch sits outside of the usual
CGI::Application framework. This really clarifies for me the purpose it:

Dispatch the URL to the right application and run mode by constructing
and calling new() and run() on a CGI::Application derived module. 

    Mark

-- 
http://mark.stosberg.com/ 


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