On Tue, May 18, 2010 at 6:07 PM, Karen Etheridge <p...@froods.org> wrote:
> On Tue, May 18, 2010 at 11:59:57PM +0200, Heiko Jansen wrote:
>> Dear Moose-icians,
>
> Heh, I like that one!
>
>> But how am I supposed to tackle this problem using Moose/PRANG? Changing the
>> 'isa' property of Moose attributes at runtime based on the value of another
>> attribute (holding the MODS version number) seems weird.
>> I'd be glad if someone could describe possible solutions and/or point to
>> existing code solving this kind of problem.
>
> How about a parameterized role that took the version number as a parameter?
> Then you could define the attribute type constraints with that version in
> mind, and all the work would be done at compile time.

I'm not sure about PRANG but this should be achievable for
Serialization (ie: to XML) with XML::Toolkit. I'm not entirely sure
how to handle parsing this way though, at least not off the top of my
head.

I kinda like the idea of this actually, though I have no clue how to
formalize it in the context of something like XML::Toolkit or PRANG.

-Chris

Reply via email to