perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunther Birznieks <gunt...@extropia.com>
Subject Re: transient object data
Date Sun, 23 Dec 2001 06:55:21 GMT
At 10:19 PM 12/22/2001, DeWitt Clinton wrote:
>On Sat, Dec 22, 2001 at 06:11:33AM -0800, brian moseley wrote:
>
> > doesn't it seem like there should be a way to denote object
> > data as transient so that it doesn't get serialized by
> > Storable, etc?
>
>I'd love that as well.  For example, when persisting Cache::Object
>instances I manually strip out transient (in this case, it is
>re-creatable) data such as the name of the key and the size of the
>object, in order to save space in storage.
>
>Sounds like Perl 6 needs a generic notion of Serializable.

I think that is fine for Perl 6, but what do we do now?

I think implementation wise it seems that there are several ways to 
serialize objects in Perl. So the natural thing to do is come up with some 
"meta data" standard that perhaps all the various authors (Data::Dumper, 
Storable, etc) like and use efficiently.

I think an object of type Transient seems OK. Then, to make an element of a 
Perl data structure transient, you would add another element to that data 
structure of type Transient.

If the data structure is an array, then the value of the Transient object 
should be an array of index numbers related to values that are supposed to 
be Transient.

If the data structure is a hash, then the value of the Transient object 
should be an array of key names related to the values that are supposed to 
be Transient.

If the data structure is an object, you would alternatively look and see if 
@ISA Transient, if it is a transient (through multiple inheritence) then 
that object type would never get serialized.

Would this cover most general cases?

So should this be a thread on p5ee or on mod_perl? :)

Later,
    Gunther



Mime
View raw message