[CDBI] Re: how can I make data returned from CDBI methods be considered untainted?

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Sat Mar 3 07:58:35 GMT 2007


Michael Schwern wrote:
> Argh! That's a private method (or at least protected)!

I prefer the term "undocumented." :-) Seriously, if I may be so presumptuous
as to debate the point with the original author of both Ima::DBI and
Class::DBI, I would say it's protected, not private. Based on some posts by
Tony on the old CDBI mailing list, my interpretation of the Class::DBI API,
which is certainly not unimpeachable, is that only methods that start with
double underscores are strictly forbidden (private). Methods with single
underscores are "mostly safe" (protected, sort of), though not absolutely
guaranteed to remain unchanged from version to version, of course. Subject to
Tony's whims, I suppose, but, over the years, several single-underscore CDBI
methods have been "officially sanctioned" for use. Overriding
_live_object_key(), for example, is the recommended way--indeed the only
way--of turning off the object index on a class-by-class basis. _croak() is
another example, as is _meta_info() back in versions 0.9x.
_default_attributes() is inherited from Ima::DBI though, as I'm sure you
know, and then overriden in Class::DBI, which then calls the same method in
its superclass (Ima::DBI); it's very clearly not going anywhere. But, you are
right though; given the alternative, passing the DBI attrs via the very
public connection() method is cleaner and preferable.

Just my two cents,
Ed



More information about the ClassDBI mailing list