Re: [Cgi-session-user] Progress with CGI::Session::Serialize::yaml
Brought to you by:
sherzodr
From: Tyler M. <ty...@yi...> - 2006-02-25 21:54:35
|
Mark Stosberg <ma...@su...> wrote: > I think there are reasons for people to want to use all the different > drivers. We discussed JSON vs. YAML previously, and ::Syck will be > preferred for performance when a C compiler is available, otherwise the > pure Perl versions will be desired. > For example, I know I want to keep using YAML::Syck, and I don't care > about "overloaded objects havin matching addresses". OK, so being that all of the drivers have the exact same interface, and they're at least forwards-compatible (YAML can read JSON), I'd suggest that we have one serializer provide all of them. With the current API this equates to something like: my $session = CGI::Session->new(undef, "s=yaml"); $session->_serializer->use('JSON::Syck'); or local $CGI::Session::Serializer::yaml::SERIALIZE_WITH = "JSON::Syck"; my $session = new CGI::Session; Do you think this is a good idea? Or should we have separate modules for YAML and JSON? > - adjust the tests to match the limitations of each. I'm using CGI::Session::Test::Default right now. The tests there are in rather large blocks, and only a few things in a few blocks are failing with JSON... My first inclination is to either subclass that and copy and paste a bunch of stuff, or refactor Test::Default so that certain tests can be skipped. I'm thinking supplying our own ok() that runs the test by default, but skips it if it's in $self->{skip_tests}. - Tyler |