http://qs1969.pair.com?node_id=650158


in reply to Large Web Application Ponderings

There is no such thing as a web application, there is only a web interface. Personally- this is what I do.. If I have a FastFood application, my tests.t, FastFood.pm, bin/fastfood, FastFood/Base.pm, etc code does nothing at all with web anything.
I develop FastFood in a terminal environment. Test it all out etc.
Once I am somewhat happy with that, I will start work on FastFood::WUI (Web User Interface).

I have come to great affection for CGI::Application, so my WUIs are CGI::Application based interfaces to ..
whatever- in this case; FastFood.
Thus, my fastfood.cgi only uses FastFood::WUI, not FastFood, FastFood::Base, none of that.

If you want to use CGI::Application- one word of advice; use as many of the plugins as possible, if they do what you want- even if what the way they do it seems counter-intuitive to you. I've found that the plugins seem at first to do some unneeded stuff.. but when I proceed with it.. things make more sense. Almost as if.. the people that came before me knew what they were doing when they suggested these ways of working.. go figure!

Compared to SQLite, in my experience- mysql is slow at inserts and fast on queries; consider doing any heavy lifting, operations.. cpu intense whatevers.. all offline, that is.. drop a crontab entry.

Keep focus on the web interface *as the web interface* and NO more. Any operations, db interactions etc.. Code all of that in your base modules. If the code is not about taking user input or displaying output- it does not belong in the "web app", the web user interface, the WUI.

My final suggestion would be to look up Conway's book on Perl Best Practices, although you probably have it already. He talks about doccumentation in there somewhere, I believe he also suggests writing the docs first, then the code. One very disciplined way to work is to write the tests first, as how you would like to interact with the non existing API- and then write your API so that the tests do not fail- I use Test::Simple- very sexy.