Contents
Overview of Data Access Application Block
Why DBHelper?
Advantages of DBHelper
Pre-requisites for DBHelper
Downloads
How to use DBHelper?
Drawbacks of DBHelper
Overview of Data Access Application Block
Enterprise library 3.1 comes with a set of application blocks
including
Caching
Cryptography
Data Access
Exception Handling
Logging
Policy Injection
Security
Validation
to simplify the development tasks. In this article, I would be
concentrating on the Data Access application block.
Data Access application block is created with the ADO.NET 2.0
classes with the intention to generalize database implementation. This
block includes an abstract base class that defines a common interface
which provides much of the implementation needed by the data access
methods available in ADO.NET 2.0. This includes classes that are
specific to Microsoft SQL Server, Microsoft SQL Server CE, and Oracle.
Major advantages using this block include
Reduce difficulties in changing the database type/provider.
Developers need not know the methodologies provided by different
database providers.
Reduce lines of code.
Why DBHelper?
Now a days applications are designed to include changes with less
number of builds. Developers mostly use XML files to store stored
procedure and function details, so that a change on any one should not
require any more builds of the application. Enterprise Library does not
provide a feature read data from an XML file to execute database related
queries.
Even though Enterprise Library helped in reducing the lines of
code, it can still be optimized. Say, consider the examples written
which uses Data Access Block.