Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Thanks to everybody who's set my mind straight regarding mod_perl. I've discovered through this that subclassing the Apache::Handler isn't the best way to do this.

I'm going to go back and rearchitect some of the main application to give me this functionality. None of the "action" objects of the app are decdendant classes, and the constructor for each of the classes are exactly the same, so that's where I'll put the magic in.

I'll go back and write an "Action" object that the rest of the objects will use as a base class, and add methods to fiddle with the session for each object. The session will be passed to the constructor, as it is now, and I'll rewrite the per-object session manipulation to use new methods.

This will allow me to emulate private namespaces within the session transparently by having the parent Action object interrogate who the caller is and create a "private" and "public" namespace that the default methods will deal with.

All in all, it's not the solution I wanted, but I think it's the right one; Apache::Handler subclassing would have worked (if mod_perl worked the way I used to think it did :), but having application-type logic contained within the application, instead of the web server classes, makes for a more logical grouping of functions.

Thanks again, everybody! I never would have seen this path if you weren't so patient in explaining why my world view was wrong.


In reply to Re: Subclassing Apache::Request? by tadamec
in thread Subclassing Apache::Request? by tadamec

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found