Appendix A. The Data Mapping Application Block


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:

[1] Application Architecture for .NET: Designing Applications and Services at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/distapp.asp.

...a layer of software that separates the in-memory objects from the database. Its responsibility is to transfer data between the two ends to isolate them from each other. With Data Mapper the in-memory objects needn't know even that there's a database present; they need no SQL interface code, and certainly no knowledge of the database schema. [2]

[2] Martin Fowler, Patterns of Enterprise Application Architecture, p. 165. Addison-Wesley, 2002.

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.




Fenster Effective Use of Microsoft Enterprise Library(c) Building Blocks for Creating Enterprise Applications and Services 2006
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications and Services
ISBN: 0321334213
EAN: 2147483647
Year: 2004
Pages: 103
Authors: Len Fenster

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net