Hi Tim,

> > > I'd be happy to allow "local_", "_", and perhaps "x_" to be used as
> > > 'private use' prefixes that would never be registered to a driver.
> > 
> > So to put this into an example, to make sure I understand correctly,
> > if I had a function I wanted to make available automatically via
> > install_method() -- say db::query_cache_report(), I'd name it with one
> > of the above, and people could then automatically say:
> > 
> >     $dbh->_query_cache_report()      # or
> >     $dbh->local_query_cache_report() # or
> >     $dbh->x_query_cache_report()
> 
> I was thinking your choice of prefix (pts) would be included:
> 
>       $dbh->local_pts_query_cache_report() # or
>       $dbh->x_pts_query_cache_report()

Ah, okay. I understand, now. That makes sense.

> [...]
>
> > What if, rather than simply blocking off an arbitrary prefix to DBD::
> > developers, there were a mechanism to allow us to specify what our 
> > prefix is?
> 
> Sorry, but I don't want to go that way.

I'm still not totally thrilled from a personal point of view -- I think
consistency is a great thing where user's expectations are concerned --
but with the (trimmed) explanations you outlined, I can understand why
you don't want to allow that, and agree that it's a reasonable restriction
in the wider context of the CPAN distribution. I also agree with your
preference for 'x_', rather than 'local_'.

> > The downside, of course, is the danger of a prefix collision with
> > a database driver which gets registered officially in DBI at a later
> > date. I don't think this is really a big issue, since it appears 
> > (according to a quick grep of DBI.pm, anyway) that the registry is
> > only used in install_method(), and if the prefix already exists, I
> > can just delete the call to register_prefix().
> 
> Ignore install_method and think about method attributes. For example:
> 
>       $sth->bind_param(1, $value, {
>               ora_type => 97,
>               ix_type => 42,
>               syb_type => 82,
>               pts_type => 13,
>       }
> 
> If you don't want to register the driver then using x_pts_ as a prefix
> doesn't seem like much of a burden.

I knew there was something I was missing while thinking about this 
(I'm not the one that writes all the DBI code around here, so writing
this driver has been my initial foray into this world).

So taking that bind_param() example, since my driver is unregistered,
I'd write that as: 

        $sth->bind_param(1, $value, {
                ora_type => 97,
                ix_type => 42,
                syb_type => 82,
                x_pts_type => 13,
        }

In the event that someone *did* actually register an official 'pts_'
prefix that gets distributed on CPAN, and we started using it, I could
then write:

        $sth->bind_param(1, $value, {
                ora_type => 97,
                ix_type => 42,
                syb_type => 82,
                pts_type => 77,
                x_pts_type => 13,
        }

I just want to clarify that I should also be using 'x_pts_' for my
internal attribute names, and not just extra method names.

Cheers,
Ammon

-- 
         Ammon Riley  *  Senior Pipeline Programmer *  [EMAIL PROTECTED]        
 
                       Rhythm & Hues  *  Los Angeles, CA

Reply via email to