[Rt-devel] Re: [PATCH] DBIx::SB::Record.pm aliases cleanup and docs

Ruslan U. Zakirov Ruslan.Zakirov at miet.ru
Thu May 5 11:01:55 EDT 2005


	Hello, Jesse, Tatsuhiko and all.

I've added maintainer of the capitalization.pm to notify about bug in 
his module that is described in the bottom of this mail.

Ruslan Zakirov wrote:
> Jesse Vincent wrote:
>> On Thu, Apr 07, 2005 at 05:01:44PM +0400, Ruslan U. Zakirov wrote:
>>>>   Hello.
>>>> Attached patch add missing aliases and some words that such aliases 
>>>> exist.
>>
>> What do you think about switching to use miyagawa's capitalization.pm
>> for this function instead?
>>  
>>
> First, I had some time to try it but with no success. I didn't find way 
> to drop capitalization in current module from module itself. This module 
> is for external users, that is reason why pragma exists at all. I'll try 
> it again under debugger, may be today tonight, just to understand why it 
> doesn't work in such way.
I've tried again and have found that capitalization.pm works from module 
itself only if you put it usage in the bottom of the module after all 
sub declarations.

> 
> Second, considering that I don't like all this jumping around method 
> naming, I see several ways to go.
> 1) Obsolete lower case naming for 2-3 releases with warning and then 
> drop it. Suggest capitalization.pm for users if they used lower case 
> variant and don't want rewrite.
> 
> 2) Maintain aliases by hand. We even can write .t file that check that 
> all functions has alias. This .t would help to maintain and check that 
> you didn't forget to define alias for new sub.
> 
> I like both solutions. The worth solution is to implement 
> cpatilazation.pm into DBIx::SB because it slows down DBIx::SB startup, a 
> little, but slowdown and that's for user to decide if he want lower case 
> methods and want to pay some CPU cycles for it.
> 
> Third, this module/pragma has a little bug and doesn't work well with 
> subs like _Accessible, because of using 'lcfirst' on return code path 
> while converting name from upper to lower case. It requires some fixing.
Yes, it also confirmed and should be fixed. Examples from debug log:
method 'LoadByCol' at .../capitalization.pm line 23.
alias  'load_by_col' at .../capitalization.pm line 25.
method '_Set' at .../capitalization.pm line 23.
alias  '_Set' at .../capitalization.pm line 25.
method '_PrimaryKey' at ...
alias  '_Primary_key' at ...

Jesse, do you have any comments and wishes?


--
Regards, Ruslan.


More information about the Rt-devel mailing list