> 
> Encapsulation demands that you should be able to replace behavior with
> state (your earlier caching example) and state with behavior without
> the outside world noticing. So at that level yes; attributes and their
> associated behaviors (accessors, readers, writers, clearers,
> predicates, etc.) are interchangeable as far as the outside world
> cares.

Yeah, that, what he said!  This is a wonderfully eloquent way to say what I was 
trying to communicate with all my Clouds.  :-)

> 
>> The way I solved my problem is via an AUTOLOAD function.  It passes
>> everything that the object supports.  It should be made even cleaner if I
>> first check if the Role implements that method. Is this a good workaround
>> for the bug, do you think?
> 
> AUTOLOAD in a system that provides Class->meta->add_method() always
> makes me queasy. However if you have it working and well tested,
> whatever gets the job done.
> 

AUTOLOAD always makes me queasy. Unless you are doing some kind of clever 
string manipulation to turn your interface from one convention to another, it 
seems like a band aid. In this case, it really is a band aid in the absence of 
full implementation of Role-based delegation.  But your point means, AUTOLOAD 
is not the way to fix the bug, just to work around it.

I am still functioning too far outside of MOP and other internals to figure out 
the right fix. I'll try to learn faster, so I could start tinkering!

Reply via email to