aristAugust has asked for the wisdom of the Perl Monks concerning the following question:

I was wondering, if anyone holds to a particular philosophy when building a dynamic secure website in perl with a mysql back end, in the way that a library tree of modules is arranged? The website has pages, buttons, areas that users with different permissions have access too etc. For example do you create a widget tree for buttons, menues, layouts of various sorts. Perhaps you have a your SQL commands put into a module in a part of the tree, and further seperated into queries, selects, Your login code is in one part of the tree together, etc. All of this in the effort to keep things organised, reduce redundant code, keep the modules concise, uncomplicated, and easy to maintain. aristAugust
  • Comment on Sensible Module organization for a fairly large web application

Replies are listed 'Best First'.
Re: Sensible Module organization for a fairly large web application
by valdez (Monsignor) on May 14, 2003 at 19:12 UTC
Re: Sensible Module organization for a fairly large web application
by dragonchild (Archbishop) on May 14, 2003 at 18:05 UTC
    What buttons? You mean the templates? Oh, yeah, those are in one part of the tree. Database layer in another (so that when you become famous and have to upgrade to Oracle, you don't have to rewrite your app from the ground up - just the interface layer). Oh, and that interface layer also allows for IPC, if necessary for synchronization.

    Hmmm ... Logging in shouldn't be something special. If it is, that specialness should be in the Apache handler, not the place it lives.

    As for modules - make modules for business objects, not developer processes. If you can't figure out what business object(s) are involved in a given feature, that means you don't understand what business purpose that feature serves, and, thus, it's a waste of time. (Worse, it'll introduce bugs into code that was fine before.)

    Basically - think like a business person who can ask things to take care of business needs. Kinda like top-down decomposition, but in terms of business, not development. Then, build objects/modules to handle those business needs. Your features are now just chains of these business things working together. :-)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.