Asp. NET application tips: Aspnetforums's data-tier overview

Source: Internet
Author: User
Tags abstract reflection
Asp.net| Skills | data

Today, one hours of time to learn anf dal, feel their own anf have a further understanding, followed by the question, in some points to publish their own experience.

Using oneself very vegetable

(1) The DAL (data layer) class composition:
ANF's data layer is mainly Forumsdataprovider (for short: FDP) and Sqldataprovider (hereinafter: SDP), the following "FDP" and "SDP" refer to the above name.

(2) The DAL (data layer) class relationship:
Forumsdataprovider and Sqldataprovider, two classes, "FDP" is an abstract class, "SDP" Inherits "FDP", and "SDP" provides all of the abstract's type that implements the "FDP". Object and type method.

(3) The DAL (data layer) class function:
"FDP" is the base class, all the underlying operations of the database encapsulated in the "SDP", the bottom through the IDataReader access to the SP and TSQL, basically an SP encapsulated the Tsql-siud, delete Mark's way to remove data, An update or insert operation is judged by the primary ID passed in.

(4) DAL (data layer) access and operation of the database steps:
When a page to the data access, first "SDP" through the query to the corresponding ArrayList, like Entityclass or ArrayList of the package class, the instance (by the API Cache, I think it is anf to improve the speed of the database read the main means) get methods, through "reflection" reflection constructs-getconstructor "FDP" abstract method and object (actually executed or "SDP" methods), Finally bind to the Repeater or DataList, such as the image, complete data reading.

I am very good at the level of food, not afraid to throw bricks ...



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.