Its been quite a few years, but here goes my first post :)
I've been working with CGI::Application, Template Toolkit, and DBIx::Class recently. Between the three, my interest in actually pushing through projects has increased dramatically. Unfortunately i'm not used to working with such a framework type deal.
On to the question...
I have a table User and a table Pets. The DBIx relation is that each User has many pets, and each pet has one owner. There are 2 cgi::app modules, Mod::User and Mod::Pet that are used for modifying certain things for each User or Pet. So, couldn't I create my scheme and get my resultset in cgiapp_prerun (in each module) and use that data throughout the module? And just close the database connection on the teardown?
I'm sorry if this is more of a design related question. I'd love for it to be that simple... ie. Mod::User's cgiapp_prerun gets the resultset for a specific user, and Mod::Pet's cgiapp_prerun gets the resultset for all pets of a specific user. Then I could just access these resultsets later on in the code.
Does this sound like a good idea?
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.