On Tue, 2004-01-20 at 01:07, Stas Bekman wrote: > Good thinking, Perrin. But you need to take it all the way through, because > I'm afraid you need to look at the whole picture and not lock yourlself in the > $r world.
You're right, I haven't looked at anything else yet. > I understand that you will want to preload that module that knows how to > AUTOLOAD the others on every handler that gets $r passed. Which works for me. Good. Do you think there should be a separate module for this, that just acts a shell for $r and AUTOLOADs other things? That would avoid loading Apache::RequestRec unless it is needed. Apache::RequestHandle maybe? > If you want to do the same thing for $s, besides the child_init/child_exist > hooks, none of the request hooks receives a server object. How do you know > when to load that wrapper for $s? How do we know if we should load the wrapper? We should always load it if we're going to give anyone $s, and it can be such a small class (Apache::ServerHandle?) that it won't add much to load it all the time. > What about the other 200+ > methods in about 30 modules? People will still need to figure out what to load > to use these (e.g. Apache::URI's methods don't necessarily work with $r, so > how do you know that you need to load that module?) I think it's fine for people to explicitly load Apache::URI in order to call methods like Apache::URI->foo(), but not for methods that are called through $r, or $s, or any other object that the user gets passed. > Where do you install that > AUTOLOAD on functions or modules which aren't $r or $s operators? I don't want to AUTOLOAD anything that isn't called through one of those. Think about it like this: $r and friends are the mod_perl API. Apache::RequestRec|IO|etc. are the implementation. If you look at things like DBI, there is a precedent for doing it the way I'm suggesting. DBI gives you a database handle, and deals with lots of AUTOLOADed stuff behind the scenes. We advise people to put "use DBD::Oracle" or whatever they are using in startup.pl as a tuning measure. This would work the same way. - Perrin --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]