On 9/15/06, Matt S Trout <[EMAIL PROTECTED]> 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?

Looks good. The main problem I think is how to properly serialize
everything (e.g. DateTime objects). Also, how'd you restrict what
fields would be serialized or not?

Sometimes besides serializing plain columns or relationships you might
also want to serialize the value of a method call on the given object,
so I think there should be a way of doing this too when using this
generic serialization interface.

As I understand, "serialization plugins" would be under a default
namespace, say, DBIx::Class::Serializer::JSON for JSON, etc. Maybe it
might make sense to define serializer for each column. This way, it'd
be easy to handle cases such as arbitrary inflated objects.

Maybe, I could try starting this stuff over the weekend or maybe at
$work on Monday.

-Nilson Santos F. Jr.

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to