Skip Menu |

This queue is for tickets about the Class-Std CPAN distribution.

Report information
The Basics
Id: 14198
Status: resolved
Priority: 0/
Queue: Class-Std

People
Owner: Nobody in particular
Requestors: stbaldwin [...] multiservice.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Serialization of inside-out classes
We currently make extensive use of the 'blessed hash' OO approach and I'm very keen to move to the Class::Std approach. However, in order to speed things up (and it does considerably), we also use Storable::Freeze/Thaw to cache objects to disk. I'm wondering if the mechanism behind 'inside out' classes lends itself to serialization. Has this been raised before, and if so, is there an implementation? Thanks, Steve
From: luke [...] daeron.com
It doesn't lend itself to serialization as written in Class::Std -- unlike with Java, class attributes are *really* private to the class code (and Class::Std) only. However, I've created a patch that will do it for Storable and Class::Std, with caveats. See here: http://rt.cpan.org/NoAuth/Bug.html?id=14231 Don't know if Damian will accept, reject, or radically modify this patch!
Date: Thu, 18 Aug 2005 11:43:48 -0700
From: Damian Conway <damian [...] conway.org>
To: bug-Class-Std [...] rt.cpan.org
Subject: Re: [cpan #14198] Serialization of inside-out classes
RT-Send-Cc:
Hi Steve, Show quoted text
> We currently make extensive use of the 'blessed hash' OO approach and > I'm very keen to move to the Class::Std approach. However, in order to > speed things up (and it does considerably), we also use > Storable::Freeze/Thaw to cache objects to disk. I'm wondering if the > mechanism behind 'inside out' classes lends itself to serialization. > Has this been raised before, and if so, is there an implementation?
There is certainly no problem with caching objects in an inside-out scheme. You could, for example, write some :CUMULATIVE methods to grab data out of the attribute hashes and serialize it. Alternatively, given that your goal is to cache data, it might be easier to tie each of the attribute hashes directly to a database. Damian
Also there is now the Class::Std::Storable module, HTH :)