-- In general, things that a user can do belong in the User class, while things your application can do with a user belong somewhere else.
Yeah, thats what I'm going for. I just saw the cookie/session stuff to more of a user type thing than an application -- because the cookie/session stuff would affect the loggedIn/virgin status of the user.
I do have a bit of a procedural model in here (psuedocode below, as I'm at work and the real code is at home):
$r = apache registry;
$user = new myPackage::User(\$r);
$page = new myPackage::Page(\$user)
$r->send_headers()
$r->print( $page->getContent )
So i instantiate a new user, who contains various methods, variables, and refs to their particular get/post and session data
Then i instantiate a new page, which contains a ref to the user who requested that page. An internal subroutine decides which page to show based on the user's get/post data , checks whether the user has enough privileges to process that page, and returns the html representation.
That seems to work well for my needs -- splitting the logic behind a user and a page into separate trees.
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.