Perrin-

> Is there a reason you can't use the OO interface that Apache::Session
> comes with?
> 
> $session->STORE('visa_number') = '7';
> print $session->FETCH('visa_number');
> $session->DELETE('visa_number');

This isn't really a documented interface - it's an overloading of the
tie methods so that the tied hash interface works. You can't find this
by reading the manpage for Apache::Session, only by reading through the
module itself or knowing enough about tie to know it's there.

> If your module is using the tied interface to Apache::Session to do its
> work, you're getting the worst of both worlds in terms of performance.

Not sure quite what you mean, maybe you can clarify? Won't You always
need to tie %session to Apache::Session::____ to create the initial
object, unless I'm missing something? Are you just referring to using
FETCH, STORE, and DELETE directly inside the methods (i.e., rather than
$session{'param'} use $session->FETCH('param') ?)

> AUTOLOAD methods can be an additional slowdown if you don't cache
> AUTOLOADed methods (i.e. if AUTOLOAD has to resolve the methods every
> time).

Good point.
 
> I can see reasons for creating an OO module that subclasses
> Apache::Session, but I would do it to add methods that don't map directly
> to a single hash key.

Exactly why I'm doing it:

   $session->visa_number(501);
   $session->visa_number;

same function, but it maps to a combination of FETCH and STORE depending
on the arguments.

-Nate

Reply via email to