On Thu, 30 Sep 2010 23:40:39 +0200, Jonathan Worthington wrote:
> Plus, we probably do need *some* way for folks to write serializers in
> standard Perl 6.

^ This.

I faced precisely this problem when trying to write persistent inside-out 
classes with Class::Std.  There was no way to break encapsulation, so I 
had to write a serialize method.  The problem was, I needed to be able to 
serialize derived classes, so each of them had to say how to serialize 
themselves.  But serialization was a role - instances of the derived 
classes weren't always persistent - and that violated the separation of 
thingummy (my terminology isn't so good here, I trust you know what I 
mean).

I don't know how you solve this but please think about this use case.  Of 
course not every object can or should be serialized but elective object 
persistence is pretty important.

-- 
Peter Scott
http://www.perlmedic.com/     http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274
http://www.oreillyschool.com/courses/perl1/

Reply via email to