perl5ever has asked for the wisdom of the Perl Monks concerning the following question:

Suppose you have an object graph - for instance, an Album object $album which has a list of Song objects:
$album = Album->new; $album->add_song(Song->new(...)); ...

It's representation as JSON might look something like:

$as_json = q{ { album_title: ..., songs: [ { song_title: ..., }, { song_title: ..., }, ] } };
The object $album also has another representation as a non-blessed perl data structure:
$as_perl = JSON->new->decode($as_json);

$as_perl is basically the perl incarnation of the json text.

I'm looking for a good descriptive name for the $as_perl representation. When converting from/to JSON and blessed perl objects, one inevitably has to deal with the $as_perl intermediate form, and I'd like to find a descriptive name to help name the classes and methods involved in the transformations.

Hope this makes sense.

Replies are listed 'Best First'.
Re: Good name for decoded json text?
by ikegami (Patriarch) on May 09, 2011 at 20:43 UTC
    $album # Object $album_data # Object's data $album_json # Object's data serialised to JSON

      Would you say the data's been 'jsonified'?

      Or perhaps it's just 'jsongled'? (json + mangled)

      Or maybe we could go really cryptic, thinking Jason and the Argonauts, and say it's been 'fleeced'? (aka. The Golden Fleece)

Re: Good name for decoded json text?
by bluescreen (Friar) on May 10, 2011 at 00:30 UTC
    How about a complete different approach:
    my $album = Album->from_json($json); my $json = $album->to_json; # or $album->as_json
Re: Good name for decoded json text?
by grantm (Parson) on May 09, 2011 at 21:31 UTC

    I generally just use $data in that circumstance. It's not really descriptive but usually its scope is fairly limited anyway.