idiotprogrammer has asked for the wisdom of the Perl Monks concerning the following question:
I have been programming in Perl for 3 years, almost entirely web based applications. I have written things like database browsers, stat apps, dynamic-data driven web sites, etc.
I am never happy with my code. I am probably the sloppiest coder ever, and try as I may I haven't improved. I still struggle with OOP. I have no problems using objects from classes written by others, but I cant write my own. Just when I think Im getting there, I get discouraged again when I try something more difficult.
Currently I am developing a "shopping cart" for some clients. I would like to get it done the right way (am going to use CGI::App). I want to make it as reusable as possible, ie the same Perl code for all users with a config file to tweak the differences for different users. Now, I want to be able to write it and have it be self sufficient. What I mean is, I want it to be like a shrink-wrapped program you may buy at a store. I cant figure out how in Perl. When I sign up a new client, I spend the better part of a day configuring it for the specific user.
Some questions:
I use Sessions stored in a mySQL db. HOw can I build into the cart each users mySQL connection parameters? Can't, obviously. So then what, leave it up to the buyer to figure out all this on install? Well, that doesnt seem good enough. I thought about using my server, and setting up a session table for each client in my db. Doesnt seem right either. Resource heavy? Security issues, etc. (I do have https however).
2) How would you distribute online such a thing? I am correct in assuming Pel cannot be compiled. What Im getting at here is I cant distribute like a install file that does all the setup for a user. IE, Joe gets my Cart App online. He downloads 1 file, uploads to his server, and somehow runs the file which does all the installation (Wow, Im even confusing myself now). So what are the other options? Distribute the source code? Doesnt seem right. Joe wants to sell Piggy Banks online and that is his specialty, he has no tech training and doesnt want to deal with source code and modifying DBI connection parameters and such.
This is a specific example based on what I am currently doing, but in a broader sense I guess I struggle with theoretical issues. Like for the cart, I can't figure out what to put in what packages, ie how to break it up. I cant figure out where to use objects, or OOP here. So I resort to doing it the sloppy way, like everything in one cart.pl file.
Well, I'll stop for now and await some replies. Sorry if I broke any PM etiquette or anything like that.
Thanks, idiotprogrammer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: developing and distributing perl apps
by rdfield (Priest) on Feb 26, 2004 at 11:15 UTC | |
by techy (Scribe) on Feb 26, 2004 at 14:30 UTC | |
by rdfield (Priest) on Feb 26, 2004 at 15:25 UTC | |
by techy (Scribe) on Feb 26, 2004 at 17:53 UTC | |
|
Re: developing and distributing perl apps
by bradcathey (Prior) on Feb 26, 2004 at 12:47 UTC | |
|
Re: developing and distributing perl apps
by Ctrl-z (Friar) on Feb 26, 2004 at 15:19 UTC | |
|
Re: developing and distributing perl apps
by Popcorn Dave (Abbot) on Feb 26, 2004 at 18:30 UTC | |
|
Re: developing and distributing perl apps
by tbone1 (Monsignor) on Feb 26, 2004 at 13:11 UTC | |
by arden (Curate) on Feb 26, 2004 at 14:47 UTC |