THE END OF Chapter 3 began to discuss how it is a generally accepted best practice that database providers are called from data access logic components. The Microsoft patterns & practices team lists several goals to strive toward when designing data access logic components in a distributed application.[1] One of the recommended best practices is for the design to expose expected functionality that is common across all data access logic components in a separately defined interface or base class. This is the fundamental principal for the Data Mapping Application Block and more specifically for its abstract DataMapper base class. Martin Fowler defines a Data Mapper as:
The DataMapper is intended to make it easy for developers of business data access logic components to create common functionality that relates to managing their "entities" with Create, Retrieve, Update, and Delete operations. Additionally, the DataMapper promotes the use of stored procedures as a best practice, facilitates the use of transactions when needed in an operation, makes it possible to configure specific command attributes like the command's timeout, and makes the ability to cache data in a data access logic component configurable. This appendix discusses how the design of the Data Mapping Application Block created in Chapter 9 is intended to satisfy the guidance promoted by the Microsoft patterns & practices team, and how to configure and develop an application to use this application block. |