[Dbix-class] RFC: DBIx::Class::JSON

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Mon Sep 18 11:58:48 CEST 2006


Matt S Trout wrote:
> I think what I'd like to see is a general serialization interface that plugins 
> can be written for. Something like
> 
> __PACKAGE__->load_components(qw/Serializer/);
> __PACKAGE__->serialization_options({ follow_rels => ... });
> 
> ...
> 
> $obj->serialize_to('JSON');
> $obj->serialize_to('XML');
> 
> etc.
> 
> How does that look to you guys?

I'm being dumb (nothing new :) This looks like a single serializer is
loaded and it is able to serialize to multiple formats? Or are the
'JSON' and 'XML' just the last part of class names? With the serializers
being loaded dynamically and sharing all the options? (though per-call
options have also been suggested, which seems a good idea).

Puzzled, Dave



More information about the Dbix-class mailing list