Extending and Modifying the Data Access Application Block

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

In its original state, the Data Access Application Block works well for typical data access scenarios. However, there may be times when you need to customize some of the application block's behavior to better suit your application's requirements. There are two ways to do this: extension or modification.

Extending the Data Access Application Block

You extend the application block through designated extension points. Typically, these are custom classes that you must write. The custom classes implement a particular interface or derive from an abstract class. Because these custom classes exist in your application space, you do not have to modify or rebuild the application block. Instead, you use configuration settings to designate your extensions.

Currently, you can extend the application block by adding a new database type. You would do this if your application needs database-specific features from a database other than the SQL Server database or the Oracle database. You only need to extend the application block if the application block's GenericDatabase class and the ADO.NET data provider for the database system do not provide the features you require. For example, the GenericDatabase object does not support special parameter prefixes for stored procedures or invoke methods that are not on the DbCommand class or the DbConnection class. In addition, the GenericDatabase class does not support parameter discovery.

You could extend the application block by creating a new database class that supports features not exposed by the ADO.NET data provider. For example, your database class could support parameter discovery. You could also extend the application block to allow your client code to remain database agnostic through type conversions or by managing SQL syntax conversions. Building a custom database class allows your application to support the entire Data Access Application Block API set and to be more compatible with the syntaxes of other databases. To learn more, see Adding a New Application Block Database Provider.

Modifying the Data Access Application Block

You modify the application block by making changes to the application block source code. This may or may not require associated configuration changes. Because changes are made to the source code, you must rebuild the application block before the modifications take effect. You must also be prepared to handle support and versioning issues. To learn more, see Modifying the Data Access Application Block.

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.