On Tuesday 06 January 2004 08:29 am, Martin Oldfield wrote:
> In part this was because I found both A::X::Session and
> A::X::BasicSession hard to either make work or understand, but also
> because I wanted a library I could use from both Perl and XSP (the
> latter being a thin SimpleTaglib layer thrown round the former).

I don't have the time to do your code justice (I'll look at it this evening) 
but I just wanted to toss in my $0.02 CAD for what it's worth (which is about 
$0.0155 USD).

A::X::BasicSession can actually be used from both XSP and Perl.  
A::X::Plugin::BasicSession creates and manages the actual session object 
itself, and dumps the tied session in the pnotes() table.  A::X::BasicSession 
is simply a convenient wrapper around the pnotes() tied object, and uses 
TaglibHelper to expose that to XSP.

So, for instance, I do the following all the time:

foreach my $field (keys %{$ctxt->{Form}}) {
    next if ($field =~ /__/);
    next if ($field =~ /\./);
    next if ($field eq 'apply');
    if ($field eq 'preference-search_results_pagesize') {
        AxKit::XSP::BasicSession::remove_attribute('search-max');
        AxKit::XSP::BasicSession::remove_attribute('search-skip');
    }
    AxKit::XSP::BasicSession::set_attribute($field, $ctxt->{Form}->{$field});
}

Now, there may be an easier way to access that, for instance by making a 
constructor.  So, you could do:

my $obj = new AxKit::XSP::BasicSession;
$obj->remove_attribute("foo");

Would anyone find that useful?  I don't mean to suggest that one person's 
implementation is better than another, but I'd like to prevent any further 
confusion with sessions in AxKit.  Two (or three?) session taglibs is already 
pretty confusing as it is.

Either that, or I'd find having a "Best Of Breed" approach useful, deprecating 
an older taglib in favor of an easier to install and use taglib that takes 
pieces of different taglibs and has a fresh new lemon scent. ;-)

-- 
/* Michael A. Nachbaur <[EMAIL PROTECTED]>
 * http://nachbaur.com/pgpkey.asc
 */

"Rome wasn't burned in a day. "


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to