Three-tier architecture is implemented in the login form (2), three-tier form

Source: Internet
Author: User

Three-tier architecture is implemented in the login form (2), three-tier form

In the previous blog, I introduced the implementation process of the layer-3 architecture I learned in the login form. I feel that I have a little understanding of it. Today, I found that I still have many shortcomings, your understanding is not deep enough. The login function is implemented again. The difference is that you use different languages --vb.net. Only in this process can you find the real problem:

I. Although I understand the call relationship between different layers, I do not know how to call or what is being called;

2. Some basic knowledge in vb.net is still lacking;

3. the unfamiliar development environment, coupled with switching between the three layers, makes yourself a little dizzy;

This is my true feeling in the early stages. However, after self-exploration, help, and information search, I finally felt a little bit confused, the following is a step-by-step understanding of Layer 3.


** Model layer


The Model layer is also called the entity layer. It is mainly used to encapsulate attribute values, reuse information, and effectively avoid SQL injection;


** D Layer


As shown in the "1" mark, an eUser entity is defined to receive information in the database and call the Model layer;


Layer B


As shown in "1", instantiate layer D to obtain a uDao object. As shown in "3", layer B calls the QueryUser function of layer D. As shown in "2, defines parameters of an object Layer for value assignment;


U Layer


As shown in "1", an object and object parameters are defined. In the "2" icon, the U layer calls the UserLogin function of layer B;

To sum up, the call between three layers is to instantiate the class at the call layer in this layer. Only the obtained object can call the properties and methods at the call layer.

Let's look back at the implementation process of self-Logon. On the one hand, my understanding of new knowledge is insufficient, and on the other hand, I can see that my skills are not solid enough, switching between three layers allows you to see how the layer and layer are called in a single step, but you may not be able to understand the specific functions, however, they still have some experience in calling them. They also do not know about the knowledge of the bridge, dataset, datareader, and stored procedure, which can be solved through data query. But fortunately, I did it again more seriously, more or less, and I hope it will help you. If you have a need for your own code, you can contact me (tl896288933@163.com), very look forward to each other!









Use a three-tier architecture to perform login form operations and join Databases

-- Logon layer-3 architecture .. 1. Presentation Layer: Generally speaking, it refers to the interface displayed to the user. The login interface you designed is 2. Business logic layer: it refers to operations on the data layer and data business logic processing. Determine the user name and write it into the database. 3. Data access layer: This layer performs operations on the database directly, and adds, deletes, modifies, updates, and searches for data ..


What is the comparison between a 2-layer architecture and a 3-layer architecture?

1. The client directly accesses DBserver in a two-layer structure.
The client accesses DBserver through middleware and other application servers in a three-tier structure.
The three-layer structure is safer than the two-layer structure.
2. It can be understood as follows: the structure of the client program accessing the server is called a two-layer structure. Adding a transaction logic processing encapsulated middleware in the middle as a communication layer-3 structure can balance data load!
3. copy some basic knowledge. (No image)
Appendix: Related Knowledge
The software development architecture in modern society is simply a N-layer architecture, where N is greater than or equal to 1. In other words: Single-host system (N = 1), Client/Server structure system (N = 2), multi-layer system structure (N> 2 ). The following is a brief introduction and comparison of these architectures.
Standalone system: this software is applicable to standalone states. Generally, it is applicable to a single application, such as dictionary software and translation software. This development method is not applicable to the development of integrated management systems.
C/S structure: the c/s structure is developed on the LAN and has the ability to centrally manage data. At the beginning, it did solve many computer development problems, at the same time, with the development of the 4GL language, the user interface is also rich, the transaction processing capability on the CLIENT side also improves the overall performance of the entire system, and enables the management information system (MIS: management Information System. See figure 1.
If we break down the C/S structure based on the concept of a two-layer architecture, we can divide it into the presentation layer (also called the expression layer) and data layer. The data layer provides a carrier for data storage, while the presentation layer extracts data from the data layer using certain technologies for analysis and display to users in a certain format. In a two-tier architecture, the presentation layer performs direct operations on the database, and most of the Business processing Logic (Business Logic, relationship rules between data) is also implemented in the presentation layer.

Figure 1: Client/Server Architecture example

Three-tier architecture: the three-tier architecture is a typical N-tier architecture, the so-called three-tier architecture is to extract the commercial logic from the data layer and the presentation layer to form a middleware server. Therefore, the three layers are: presentation layer, Business Logic layer, and data layer. In addition, there is also a distributed system structure, which is shown in figure 2.
Figure 2: Structure of a Distributed System

In a distributed system, only an application server is located between the client and the data end. It manages the client software without performance adjustment, for example, a new database connection is generated when each client is called, and the connection cannot be maintained to form a connection buffer pool. Although some commercial processing logic has been integrated in distributed applications, the original C/S architecture has not actually changed.
In the three-tier architecture, the presentation layer mainly provides the interaction function with the customer. The data layer provides all the data storage carriers in the system, the business logic layer integrates the business processing logic of the entire system to form Middleware on the third layer. Middleware plays a leading role. The presentation layer calls the middleware through IDL for client requests. Middleware converts requests to data processing principles and obtains corresponding data from the database, the software returned to the client is displayed as required by the customer. See figure 3.
Figure 3: three-tier architecture

We have briefly introduced the C/S structure and the three-tier architecture, and the advantages of this architecture have been clearly revealed. To help you better understand the differences between the two, we will make some comparisons between the two.
Disadvantages of the C/S structure:
Lack of effective centralized control: among the numerous C/S software, it is not difficult to see that all components cannot be integrated in one location (such as a machine ...... remaining full text>

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.