Glark!

pdcawley on 2002-12-24T06:16:14

Pixie, the Object persistence system I've been working on for the past few months just got picked for the Perl Advent Calendar. Which means I should really pester James, who is Pixie's CPAN owner into releasing the latest code which fixes some DBI locking issues and finally adds Garbage Collection.

I note too that one of the classes that Mark uses as an example of a class that will Just Work with Pixie is 'URI', which doesn't quite work out of the box -- it uses a blessed scalar ref as its representation, which Pixie assumes is unstorable as it stands -- blessed scalars are the commonest placeholder for objects that store their state elsewhere via XS so Pixie assumes they're unstorable. In the case of URI, which doesn't store any extra data anywhere, the fix is simple, just do sub URI::px_is_storable { 1 } somewhere and your problem is solved. I wonder if there's a case for keeping a list of 'known good' classes like URI so people don't have to jump through even that small hoop...


Example Changed

2shortplanks on 2002-12-24T12:39:41

I changed the example to use a Math::BigInt instead.

I was thinking about all of this. What Pixie really needs is big collection of Complicity code that can be loaded as and when needed. I was thinking maybe a coderef in @INC to check what modulss are being loaded and to load the associated complicty code at the same time for anything it knows about.

What do you think?

At very least, we could do with a web page that has known good, known bad, and known solutions pulished to it.

Re:Example Changed

pdcawley on 2002-12-24T16:22:58

I've not really thought about it that hard to be honest. I'm considering adding a Pixie::Memento helper class to the distribution which would at least make the pattern involved explicit.

Of course, if Pixie became ubiquitous it'd be easy -- module authors would simply provide an 'official' px_freeze and px_thaw. Well, a chap can dream can't he?

Re:Example Changed

darobin on 2003-01-02T13:35:14

How about a global flag that turns off the checks on storing a scalar to make it storable? Users that know what they're doing might be happier with that smaller hoop to jump through. Alternatively, you could look to see if the class that the blessed scalar belongs to has made friends with Dynaloader or Inline::*.

Consider me Pestered :-)

james on 2002-12-24T18:11:37

Once I get back into work on the 3rd I'll get going with another release.

James.