Daab Database

Topics: Data Access Application Block
Aug 15, 2008 at 7:29 PM
Why the Core of the DAAB (ie Database and some others class) do not manipulate Interface object (IDbCommand, IDbConnection, IDbDataAdapter, IDbDataParameter & IDbTransaction)  instead of directly using the abstract class ? (DbCommand, DbConnection, DbDataAdapter, DbDataParameter & DbTransaction)

I need to encapsulate the Odp.Net connection for security purpose (i made my own Odp.Net provider to use Daab with Oracle native provider) to catch the Open() command and do some connectString manipulation. Since i cant inherit the Oracle.DataAccess.Client.OracleConnection (it's a sealed class) i decided to just make a class implementing the IDbConnection with an inner OracleConnection. But the problem is that the Daab want my provider to give him DbConnection object and my class implementing IDbConnection is simply not a DbConnection object :S.

I dont see why Daab dont manipulate Interface object.

I know i can simply modify the Daab but i also wanted to use Daab without modification (only extention).

Aug 15, 2008 at 7:50 PM


The reason DAAB uses the abstract classes since v2.0 of EntLib is that it relies on ADO.NET's DbProviderFactory, which itself uses the abstract classes instead of the interfaces.

Which version of ODP.NET are you using? ODP.NET v2 seems to provide implementations of the abstract Db* classes in the Oracle.DataAccess.Client namespace.


Aug 18, 2008 at 3:11 PM
Thx Fernando

I use Odp.Net v2.102.4.0 and yes it provide implementations of the abstract Db*. But i wanted to catch the .Open() of the connection to make my own security code with the ConnectString and, like i said, I can't inherit the OracleConnection cause it's sealed.

I double checked the Daab and you're right, Daab can't just use the interface. It use functionnality of the Db* not present in the IDb* (especially with the DbCommand and the IDbDataAdapter) .

I'll check for a different approach...