Extending the Data Access Application Block

Microsoft Enterprise Library 5.0

DropDown image DropDownHover image Collapse image Expand image CollapseAll image ExpandAll image Copy image CopyHover image

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.