What I'm doing with my website engine is what others have
mentioned: I'm segmenting core functionalities into their
own modules, complete with their own accessor methods, as
a layer of abstraction between my application and the
appropriate CPAN modules (CGI::, DBI::, etc). My aim is to
create a Site::Request object, which is an interface to the
CGI:: module, pass the reference of that to the Site::Auth
object (which manages session state and user permissions),
which creates the Site::SQL object, which in turn
creates the DBI:: object. The core kernel code then passes
the references to the ::Request and ::Auth objects to my
templating subsystem module, Site::Template, to produce the
output.
Currently, glacial development speed notwithstanding, it
appears to me to be a valid and pliable approach. I'm
considering ways to incorporate other tertiary modules for usage
into the templating subsystem, like page creation and
modification tools, without having to use standalone scripts
in something like a seperate document subdirectory.
I suppose each of my modules could be considered standalone
in functionality and abstraction,
but each relies on the successful creation and execution of
the previous modules. It seems the most sensible thing to
me. I'm trying to make this code as portable and flexible
as possible; I'm currently on a non-mod_perl web host,
sharing resources with other domain owners, but down the
road things may change. Having to switch over from MySQL to
PostGreSQL should be easier this way. With the way the
modules themselves are written, there are very few
non-constant globals (everything else is in object instances),
so the switchover to a mod_perl environment should, in theory,
be painless as well. One could hope, right?
-Shawn / (Ph) Phaysis
If idle hands are the tools of the devil, are idol tools the hands of god?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.