Re: calling methods on deserialized objects
- From: "Michael Küper" <somone@xxxxxxxxx>
- Date: Sat, 26 Aug 2006 01:35:14 +0200
thanks for your reply ...
I've haven't used CGI::Session, but I don't think it'll work for twoWhat "internal connection" are you refering to? As far as i know, an object
reasons:
1) serialization and deserialization breaks the internal connection
between hashes and their associated classes, and
is nothing more than a blessed hash reference!? So the "connection" between
hashref (object) and package (class) is the blessing (the packagename stored
with the hashref), or am I missing something here? If there IS actually
something more, this would explain the behaviour ...
2) after deserialization, objects referred to by references may be inThis is not a problem (at least in my case). The serialized structure looks
different locations.
good (I had a look at the session text file), references are replaced by
their serialized target, no memory address pointers inside ...
I have three bits of advice: 1) bless the hashes back into theirthey do have the correct class! (since ref($hashref) returns the correct
respective classes after deserialization,
name).
2) use custom serialization and deserialization methods to reconstruct thewould be an option ...
object tree for each request, and
but I still hope to find a way to use the default session deserializer.
3) make sure the objects' package (class) files are loaded beforeThis is something I thought of too ...
deserializing.
I will check, if this helps. But anyway: if the packages would not have been
loaded, the "eval-way" of calling the method could not have worked, could
it?
This post is a WAG so forgive me if I'm totally off the wall.I don't know what WAG stands for, but i forgive you in any case and thank
you for your time :-)
PS.If there is some "internal bytecode" could you please give me a link to an
The ref() function returns a string of text and, by itself, is no
indication that the internal bytecode that connects a hash reference to a
class is still there.
explanation? Cause I didn't find anything like this in my perl book.
kind regards
Michael
.
- Follow-Ups:
- Re: calling methods on deserialized objects
- From: Mumia W.
- Re: calling methods on deserialized objects
- References:
- calling methods on deserialized objects
- From: Michael Küper
- Re: calling methods on deserialized objects
- From: Mumia W.
- calling methods on deserialized objects
- Prev by Date: Re: Perl module that simplifies creation of packages?
- Next by Date: Re: calling methods on deserialized objects
- Previous by thread: Re: calling methods on deserialized objects
- Next by thread: Re: calling methods on deserialized objects
- Index(es):
Relevant Pages
|