Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Large Web Application Ponderings

by leocharre (Priest)
on Nov 11, 2007 at 17:12 UTC ( #650158=note: print w/replies, xml ) Need Help??


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.

Replies are listed 'Best First'.
Re^2: Large Web Application Ponderings
by dragonchild (Archbishop) on Nov 12, 2007 at 02:41 UTC
    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.

    Spoken as a true programmer ... as in, someone who isn't a DBA. The SQLite DBMS is a great toy. It can be a useful development aid. But, unlike a RDBMS, SQLite doesn't enforce relationships, types, or anything that one would need to ensure data integrity. It doesn't have transactions (ACID or not), proper indices, and a lot of other stuff. In other words, the moment your application started being real, SQLite would do anything from fall over immediately (best case) to corrupt your data without you knowing it (worst case).

    While I prefer MySQL (using the InnoDB tabletype only), PostgreSQL, Oracle, DB2, Sybase / SQL*Server ... anything that's ACID-transaction compliant, provides proper foreign keys, indices and the rest of it is necessary for a proper application. This isn't optional.

    The rest of what you said - the WUI thing is a really cool concept that I think I'll be grabbing. But, data is the foundation of an application - treat it properly or it will beat you senseless.


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://650158]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2022-08-09 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?