Re: Planning for maintenance

From: Uri Guttman (uri_at_stemsystems.com)
Date: 12/15/03


Date: Mon, 15 Dec 2003 16:38:28 GMT


>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:

> Alan J. Flavell <flavell@ph.gla.ac.uk> wrote in comp.lang.perl.misc:
>> On Sun, 14 Dec 2003, Eric J. Roode wrote:
>>
>> > Second, imho, by fully-qualifying all of the function calls, you're
>> > making a lot of extra typing for yourself, and limiting future
>> > flexibility. If you choose to move half of the function calls to a
>> > different module someday, you'll have to edit all of the function
>> > call invocations to have the new module name, as opposed to simply
>> > changing a declaration or two at the top of each program.
>>
>> Indeed. On the other hand, if you'd had the bad-fortune to choose a
>> function name which later turned out to clash with some other needed
>> module...

> ...all is not lost. This renames a function on import:

> use Exporter::Renaming;
> use MyModule Renaming => [ clash => 'no_clash'];

i had proposed a grant project to TPF for a similar thing. this module
would actually be used by the module writer and not the user. it would
allow a user to either have an OO or procedural interface (similar to
what cgi.pm does) by having a private default object for the OO. but
because it would export names to the user namespace, i wanted to support
renaming in the use line. so the real module would use this (called
class::procedural) and list the exported names in some global (possibly
@EXPORT) and the user would pass a map (in the use line for the module
they want) of names to renames.

i will have to investigate Renaming to see how it does this. in any
case, the class::procedural stuff would still be useful if i ever get to
writing it. i can't get grants now that i am on the tpf steering
committee.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org