Re: Some questions on CDBI code
[prev]
[thread]
[next]
[Date index for 2005/07/05]
On Tue, Jul 05, 2005 at 05:25:40PM +1000, leif.eriksen@xxx.xxx.xx wrote:
> OK, I've leave the $me alone, would you rather I did a
> $them->can('construct') test ? That is more constrained than a
> $them->isa('Class::DBI').
That's fine.
> I know a class could support this via an
> AUTOLOADER, and hence can() will fail, but I guess the aim is to check
> that the supplied class supports the required interface, rather than
> force a particular inheritance.
I wouldn't too much about AUTOLOADER. If someon really has such an
unlikely set up they can always stub the sub.
> Code would be
> sub new {
> my ($me, $them, $data, @mapper) = @_;
> return unless $them->can('construct'); # supports required i/f
I presume the real code will be more than a 'return' here...
Thanks,
Tony