I spent more than an hour studying ANF's DAL today. I feel that I have a better understanding of ANF. I also have questions that arise, so I would like to share my experience at some points.
using I am very good at it
(1) DAL (data layer) class composition:
The data layer of ANF is mainly ForumsDataProvider (abbreviation: FDP) and SqlDataProvider (abbreviation: SDP). The following "FDP" and "SDP" refer to the above names.
(2) DAL (data layer) class relationship:
For the two classes ForumsDataProvider and SqlDataProvider, "FDP" is an abstract class. "SDP" inherits "FDP". "SDP" provides all abstract type objects and type methods that implement "FDP".
(3) DAL (data layer) functions:
"FDP" is the base class. All underlying operations on the database are encapsulated in "SDP". The underlying layer accesses SP and TSQL through IDataReader. Basically, TSQL-SIUD is encapsulated in an SP. Data is deleted through Delete mark and passed through The entered Primary ID determines whether it is an Update or Insert operation.
(4) DAL (data layer) steps to access and operate the database:
When a page wants to access data, "SDP" first queries the ArrayList corresponding to the object EntityClass or the encapsulation class of ArrayList, the Instance (which is cached by the API, I think it is the main means for ANF to improve the database reading speed) Get method, through "reflection mode" reflection construction - GetConstructor "FDP" abstract method and object (the actual execution is still the "SDP" method), and finally Bind to an object such as Repeater or DataList to complete data reading.
I am very good at it, and I am not afraid of people throwing bricks...
http://www.cnblogs.com/sellnet/archive/2006/08/31/491438.html