On Mon, 2004-03-22 at 13:04, Chris Ochs wrote: > Rather than passing stuff around in globals or via pnotes, I was thinking > about making a request object and then using an all OO structure. Modules > that have functions that are called via callbacks could have a new() method > that is called before the template processing, and the new method would be > passed the request object so it can setup all the variables it needs for the > other methods that are accessed via callbacks at a later time. > > Does this sound like a good way to go?
It's pretty hard to say without knowing a lot more about your application's design. Passing data about the current request around in an object is a very common design (used by apache itself), so you shouldn't be too concerned about that. Just make sure you don't need to keep a copy of this object anywhere that won't automatically go out of scope at the end of the current request. I tend to prefer setting things up as a pipeline over using callbacks from a view, but it depends greatly on the nature of the application. - Perrin -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html