Development of WinForm Project (2) Project Code Analysis

Source: Internet
Author: User
Tags continue

In many cases, a lot of beginners will soon ask me: I was transferred from other languages to C # development, there are some basic information for us to learn it, your frame feel too big, want to have a step-by-step tutorial or video to learn the good.

In fact, maybe we are faced with too many things every day, feel a lot of common, even in very small places, we may have formed a habit. Conversely, if we switch to other areas, such as iOS, Android, then we may not know much about the rules in many of the designs, and the beginning may also be confused.

This article continues with the previous "progressive development of WinForm Project (1)--Database design and project Framework Generation", continue to explain how to develop WinForm projects step-by-step, continue to analyze the introduction of WinForm project code, so that we better understand the layering and the composition of the project framework and so on.

1. Definition of data access interface

Above we analyze the definition of entity classes, and this section continues to analyze the contents of other parts, such as the definition of data access interface as shown below.

Namespace WHC. Testproject.idal
{
    ///<summary>
    ///Customer information
    ///</summary> public
    Interface Icustomer : ibasedal<customerinfo>
    {
    }
}

This code is very simple, there is no extra line of code, then what happened inside, what is the definition of ibasedal?

In fact, Ibasedal is the definition of a lot of our development to use the basic interface, such as the standard additions and deletions, as well as the derivative of some other interfaces, such as paging query, conditional query and other interface content. This icustomer is used to define a business interface that is not implemented beyond the standard interface.

Ibasedal provides a strong type of data type designation for the base class interface by passing in an entity class, improving our development efficiency and reducing the chance of error.

We can see the definition of ibasedal in VS, as follows:

You can see that many of the relevant interface definitions, there are return of the entity T, there are return list<t>, as well as DataTable types, and so on, these basic interfaces, through our multiple project application practice, has gradually stabilized and can provide a good interface support, convenient for us to quickly call processing.

Even if we do not implement any business interfaces, we can basically accomplish most of the data manipulation functions by using only standard base class APIs.

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.