Practical .NET Data Access Layer - 8

zhaozj2021-02-16  59

3. Data Access Façade

Discuss DAF, or first come first to see the code:

Code 7: What is DAF?

// Dafbase: Provide basic Data Access support required to most applications,

// including call DAL methods, etc.

Public Abstract Class Dafbase

{

Public Dafbase () {}

Protected Virtual Defbase CallDalmethod

Object [] Paramsvalue)

{

DEFBASE RESULT = NULL;

...

Return Result;

}

...

}

Is it enough FAINT? The so-called Dafbase is a way!

However, it is not difficult to see from the method name, it is through it, we can call true

Positive data access (Data Access Logic) function, and the link to their link is

Data Entity Façade already discussed!

Imagine if there is no Data Entity Façade, we can easily

Is this called in a unified manner (for example: Data Entity is DataTable or

XML, or even ObjectSetj?

Perhaps, some friends will say: That is not difficult, can you use the object type directly? If this is true, then, please do a test, you know how unrealistic (N more places need to judge Data Entity Type and mandatory type conversion, this is different from the implicit operatorl)!

Next paragraph: http://www.9cbs.net/develop/read_article.asp? Id = 27551

转载请注明原文地址:https://www.9cbs.com/read-24100.html

New Post(0)