Microsoft is deprecating OracleClient (System.Data.OracleClient) class from 4.0. Source - Click Here . Vendors are suppose to provide appropriate implementation. Vendor, in this case Oracle, has come up with the its own set of classes that can be plugged into .Net to access Oracle database - Oracle.DataAccess. Using Oracle.DataAccess has got lot of benefits including Bulk Copy/Updates. Ok, so what? Are we suppose to update the code base to use Oracle.DataAccess? I am sure, applications following design pattern will have a generic data access class that interacts with the database. i.e. any talk to database will happen via this class. So, does this make the job simple? Changing the generic class to use Oracle.DataAccess solves the problem? Yes, to some extent. However, imagine the case where the application need to interact with
1. Both Oracle and SQL OR
2. Support backward compatibility to make use of both System.Data.OracleClient and Oracle.Data.OracleClient
How do we achieve this?
Classes in System.Data.SqlClient, System.Data.OracleClient, Oracle.Data.OracleClient derives from common interface: IDbConnection, IDbCommand, IDbDataAdapter, IDbTransaction etc.
Something striking?
Factory Pattern - Create a generic class which return the interface instead of objects and use the interface to perform the database operations. Drop me a mail if you are interested in the Generic Data Object class.
1. Both Oracle and SQL OR
2. Support backward compatibility to make use of both System.Data.OracleClient and Oracle.Data.OracleClient
How do we achieve this?
Classes in System.Data.SqlClient, System.Data.OracleClient, Oracle.Data.OracleClient derives from common interface: IDbConnection, IDbCommand, IDbDataAdapter, IDbTransaction etc.
Something striking?
Factory Pattern - Create a generic class which return the interface instead of objects and use the interface to perform the database operations. Drop me a mail if you are interested in the Generic Data Object class.
No comments:
Post a Comment