develooper Front page | perl.perl6.language | Postings from October 2010

Re: [perl6/specs] 58fe2d: [S12] spec setting and getting values ofattribute...

Thread Previous
From:
Peter Scott
Date:
October 1, 2010 02:06
Subject:
Re: [perl6/specs] 58fe2d: [S12] spec setting and getting values ofattribute...
Message ID:
20101001061422.16753.qmail@lists-nntp.develooper.com
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/

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About