develooper Front page | perl.moose | Postings from February 2009

Re: implications of using Any::Moose

Thread Previous | Thread Next
From:
Jonathan Swartz
Date:
February 28, 2009 16:04
Subject:
Re: implications of using Any::Moose
Message ID:
B0B1C22F-D3DB-4D01-B8A7-FE2F51AEDFDD@pobox.com
Upon reflection, while I appreciate the sentiment of Any::Moose, the  
automatic backer selection is a little scary. If an application starts  
using a new module or changes the order of its 'use' statements, the  
selection of Moose vs Mouse can change silently for all Any::Moose- 
based modules. Any behavioral differences or bugs between the two will  
show up without apparent reason. This is classic action-at-a-distance.

I suppose the same could be said for other 'Any' modules like  
YAML::Any and Config::Any. But this one seems more critical than  
those. :)

Jon

On Feb 28, 2009, at 3:37 PM, Jonathan Swartz wrote:

> Yup - I realize now I was using an older version of Any::Moose. The  
> newest one works.
>
> On Feb 27, 2009, at 10:17 PM, Sartak wrote:
>
>> Hi Jonathan,
>>
>> On Fri, Feb 27, 2009 at 7:27 PM, Jonathan Swartz <swartz@pobox.com>  
>> wrote:
>>> (resent - first attempt seemed to have gotten lost)
>>>
>>> I'm thinking of switching the CHI distribution from Moose to  
>>> Any::Moose, as
>>> a way to reduce install dependencies and overhead. The Mouse  
>>> feature set is
>>> adequate for my needs.
>>>
>>> But I realized that classes could get split between Moose and Mouse
>>> depending on if/when Moose was loaded. e.g.
>>
>> This is certainly an issue that we ran into with Squirrel. One of the
>> reasons I wrote Any::Moose (other than having the far better name)  
>> was
>> to address this issue.
>>
>> Once Any::Moose chooses Moose or Moose at runtime, it will continue  
>> to
>> use the same backer. If you find that's not the case please let me
>> know.
>>
>> There's a test in Any::Moose to ensure this happens:
>> http://tinyurl.com/bgyzvf . Notice how on line 27 Moose is loaded,  
>> but
>> the line 32 Any::Moose still gives you Mouse.
>>
>> Shawn
>


Thread Previous | Thread Next


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