J
Jim Heavey
I have been reading about design strategies which recommend creating a
"Base Class For DataAccess" - with the idea being that you can basically
switch between database vendors and updates to the "drivers" such as
ADO.Net.
I have created a base class which implement the IDbCommand, IDbDataAdapter,
IDbDataParameter methods, where this class is creating the specif type of
Command (Sql, OLDB, etc.) and returning the appropriate "ID" object.
The ID object do not encompass all the methods which are needed, just the
ones which are shared by all. So what is the recommended approach to deal
with these methods?
Say I want to Set the "IsNullable" property on a SqlParameter. That
property is readonly at the IDbParameter. In order to set this, I ahve to
"reclass" the IDbParameter to a SqlParameter in order to set it. Is it
more appropriate to implement these types of methods in the BaseClass or
create another class which implements these specific methods, or am I just
not seeing a better way to deal with these types of issues.
You comments would be greatly appreciated.
Thanks in advance for your assistance!!!!!!!!!!
"Base Class For DataAccess" - with the idea being that you can basically
switch between database vendors and updates to the "drivers" such as
ADO.Net.
I have created a base class which implement the IDbCommand, IDbDataAdapter,
IDbDataParameter methods, where this class is creating the specif type of
Command (Sql, OLDB, etc.) and returning the appropriate "ID" object.
The ID object do not encompass all the methods which are needed, just the
ones which are shared by all. So what is the recommended approach to deal
with these methods?
Say I want to Set the "IsNullable" property on a SqlParameter. That
property is readonly at the IDbParameter. In order to set this, I ahve to
"reclass" the IDbParameter to a SqlParameter in order to set it. Is it
more appropriate to implement these types of methods in the BaseClass or
create another class which implements these specific methods, or am I just
not seeing a better way to deal with these types of issues.
You comments would be greatly appreciated.
Thanks in advance for your assistance!!!!!!!!!!