I swear I haven't had an excessive amount of caffiene latey. I think I'm
slightly under-worked at the moment, which has given my idle mind time
to wander...
::Plugin::TT and ::Plugin::AnyTemplate and ::Plugin::TemplateRunner all
offer to guess the file name of the template for you. Ruby on Rails and
other Hot New MVC frameworks do this, too.
So maybe there's something to it.
But all three of the CGI::App plugins that do this differently. Here's a
summery of the strategies used, with commentary:
AnyTemplate will just use the run mode, so:
form_display.html
This doesn't scale on its own. If I have two sub-projects that use
forms, I have a collision. A workaround could be to set the
tmpl_path() for sub-projects that use the same run mode name.
-----------------------------------------------
TT will use the current package name, so:
My/App/form_display.html
This might be too verbose. It would be nice to trim off the 'My'
directory level, since absolutely everything might be under My/App.
It is prone to collisions if two instance scripts use the same module,
but want to have different templates. Again, that can be addressed
with tmpl_path(), (That's what tmpl_path is for).
-----------------------------------------------
TemplateRunner will use the URL, so: myapp.cgi/really/rocks.html
Becomes:
really/rocks.html
With this design, you can manage the verbosity of the directory
structure and your collisions by how you structure your URLs.
But the strength could also be a weakness if minor URL tampering
causes the template not be found.
-----------------------------------------------
Which one do you prefer? Myself, I can't decide yet.
Mark
---------------------------------------------------------------------
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.