On Thu, Jun 26, 2003 at 10:03:28PM +0100, [EMAIL PROTECTED] wrote:
> Tony,
> 
> I've tested a bit. Class::DBI objects survive Storable freeze/thaw cyles just fine.
> To get a standard testring ground I removed my "anti-stringificaton" overload.
> Modifing PlClient.pm seems to tell me that a string is returned instead of an 
> object. The ClientObject
> method is going to create a client stub return object on the next code line after 
> "die".
> 
> sub ClientObject {
>     my $client = shift;  my $class = shift;  my $method = shift;
>     my($object) = $client->Call('NewHandle', $class, $method, @_);
>     die "Constructor didn't return a TRUE value" unless $object;
> 
> use Data::Dumper;
> print( join'#', ref $object, "PlClient", Dumper($object) );
> 
>     die "Constructor didn't return an object"
>       unless $object =~ /^((?:\w+|\:\:)+)=(\w+)/;
>     RPC::PlClient::Object->new($1, $client, $object);
> }
> 
> Output:
> 
> #PlClient#$VAR1 = '2';
> Constructor didn't return an object at /usr/share/perl5/RPC/PlClient.pm line 127.
> 
> '2' is the id string of the correct Class::DBI find_or_create call. Is it worth 
> trying to
> make my own simple, non-CDBI-based class, overload stringification and test 
> RPC::PLClient with it? It looks like
> it's RPC::PlClient 's fault, not Class::DBI. OTOH the base of DBD::Proxy should be 
> well tested.

I don't think there are any DBD::Proxy or RPC::PlClient tests that
test overload stringification.

The $object =~ /^((?:\w+|\:\:)+)=(\w+)/; it's using is wrong.

Something like

        unless UNIVERSAL::isa($object, 'UNIVERSAL');

would be better.

I'd imagine that Jochen Wiedmann [CC'd] would accept a tested patch.

Tim.

> Is the better stringification control of Class-DBI-0.93_05 a workaround?
> I could simply skip stringification:
> 
> sub stringify_self { return shift };
> 
> }
> 
> 
> Thank you very much.
> 
> Johannes Nie
> 
> P.S: I oversimplified the object checking code in my last mail...

Reply via email to