in reply to Lazy fetching role for API clients' objects

I have really early prototype for MooseX::LazyFetch. You can have a look at it: MooseX::LazyFetch, MooseX::LazyFetch::Role, MooseX::LazyFetch::Meta::Trait::Attribute

It should be used like that:

package Test; use Moose; use MooseX::LazyFetch; has id => (is=>'rw'); has x => (is=>'rw', lazy_fetch => 1); has y => (is=>'rw', lazy_fetch => 1); has z => (is=>'rw', lazy_fetch => 1); around 'fetcher' => sub { my $orig = shift; my $self = shift; return {x=>42,y=>3.14,z=>777}; # As if it fetched it }; 1;

Once somebody try to access x,y or z, it will call fetcher, and set all attributes that are designated for lazy fetching