%% "M.W. Koskamp" <[EMAIL PROTECTED]> writes:
mwk> sub connect{
mwk> my $class = shift;
mwk> my $class = ref($class) || $class;
mwk> return bless $class->SUPER::connect(@_), $class;
mwk> }
I don't see how either of these are any different from what I said I
already tried in my original message:
sub connect {
#... figure connect info $data_source, $username, $password
my $this = $class->SUPER::connect($data_source, $username, $password);
return bless($this, $class);
}
?
%% Stephen Clouse <[EMAIL PROTECTED]> writes:
sc> On Thu, Apr 19, 2001 at 05:42:43PM -0400, Paul D. Smith wrote:
>> I'm trying to create a subclass of the DBI class.
sc> Look at t/subclass.t in the DBI distribution for an example.
sc> Subclassing DBI isn't as simple as setting @ISA -- but it isn't
sc> terribly hard either.
Hmm. I'll check it out to see if it's worthwhile.
I really feel that my need _is_ for subclassing, not a "use" situation:
I want to override the connect method and I want to add my own methods
that "feel" like normal DBI methods.
However, this may be too complicated. The new methods I have are in
some ways just intermediate steps in moving to a completely DBI solution
(except I'll probably keep my own connect function); I thought it would
be easy to subclass DBI and get it all "for free" but if it's not
trivial then maybe I'll just leave them as functions, as they'll be
removed at some point anyway.
Thx.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> HASMAT--HA Software Methods & Tools
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.