Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Design of dynamic website in Perl 1

Status
Not open for further replies.

SPrelewicz

Programmer
Jul 16, 2001
124
US
I am implementing our site into a full database driven dynamic site. I am having a hard time making up my mind about how the design of the scripts should go.

Specifically- Is it best to have one script that controls the entire page and import modules into that script that do other things. For example, I have a module that handles users creating and editing their accounts. Is it best to have one driver script, and in that script check a parameter for what the user wants, in this case 'create account'. Then in the driver script import the Account module to do the functions, or make the module a separate application and send the user to that script.

Most of my questions on this forum are theoretical ones like this. I have trouble with that stuff, or maybe I think too much :)

Again, thank you.
 
You may want to employ a content management system like

or or
EWEEKs Magazine reviewed these three free options and like the bricolage best (while they had some reservations about it an some advantages with the others). The bricolage system is an offshoot of . They (Bricolage) have a link to the eweeks review on their page.

'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
You have the right idea, use and object oriented approach. This is what you are talking about. It will make you project much more scalable.

Example:
/usr/bin/perl -w
package CONTROLSCRIPT;

#Tell PERL where modules are
use lib ('/path/to/modules/', '/path/to/some/other/modules');

#get modules
require mymodule;
require registration;

#setup interfaces to modules
$CONTROLSCRIPT::GLOBALS = mymodule->new();
my $reg = registration->new();

#use a global
$this = $CONTROLSCRIPT::GLOBALS->{'globalgroup'};

#execute command in another package

$reg->register_person('group' => $this);

#This is an example of using modules on and OOP manner
#the new() subroutines are:
sub new {
$pkg = shift;
$obj = {};
$obj = bless $obj, $pkg ;
return $obj;
}
#These are returning interface structure to your packages





haunter@battlestrata.com
 
That's a great module, I'll be using that for everything from now on!

Now, more theory questions. Let's say my Account app. Should I have separate CGI::Application modules for Creating an Account, Editing an Account, Account Authorization, etc...or put them all in one module? I know it can be done both ways, which would you do?

I use Apache::Session also. Would I put a session check on each instance script or is there a cleaner/better way to do that?

Thanks so much.

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top