Re: Why aren't there any interfaces?? by William
William
Tue Jan 06 21:54:31 CST 2004
CG:
What benefit are you looking for? I make no pretense on being the Pattern
know it all, but what would such an interface solve? I'm not arguing
against your claim, but implementing IDBConnection makes perfect sense, as
does IDBCommand. But what would you do with IDataSet? There's no
ISqlDataSet or IOleDbDataSet that would do anything different from DataSet
and since DataSets are as decoupled as it gets, what common properties would
such a thing share across the board? I ask this from purely an intellectual
POV, I simple don't know, but that doesn't mean I think you are wrong - I
just don't understand the objective?
I've seen for instance Rocky Lhotka's version of a DataReader which handles
Null values. Clever and Brilliant. But DataReaders are coupled to a
Database so the same 'null' problem that Oracle programmers deal with
confronts Sql Server Programmers. Could the same be said of a DataSet
though? Yes, you could claim that the null thing confronts everyone because
of NullReferenceExceptions. However, a subclass would solve this wouldn't
it? And is Rocky's method contrary to this? I don't think so, I think it's
totally consistent. Anyway, I'm babbling, and am probably wrong, but I'd
like to see why.
Bill
"cg" <me@tryitnexttime.net> wrote in message
news:%23V47CYK1DHA.2636@TK2MSFTNGP09.phx.gbl...
> I'm working with DataSets in my code and cannot find a suitable Interface
to
> reference.
>
> As a work-around, I've written an Interface (IDataSet) that defines all of
> the public method signatures of a DataSet class. A custom class
(DataSetExt)
> implements that Interface and delegates public method calls to *base*.
>
> I know that in taking this approach I've left myself open to a slew of
> potential problems especially if the signatures of the DataSet class
change.
> However, the System.Data.DataSet class has no primary interface....????
>
> Any thoughts on this?
>
> thx
>
>
>