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

Matt S Trout dbix-class at trout.me.uk
Mon Sep 18 12:23:31 CEST 2006


Dave Howorth wrote:
> 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).

Single base serializer, multiple output options (probably defaulting to a 
last-part-of-class-name thing), default options, default options per output 
generator, per-call options as well. So to summarize -

[X] All fo the above. And a pony.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list