Traditional Culture Encyclopedia - Traditional culture - The difference between two-tier structure mode and three-tier structure mode of software development

The difference between two-tier structure mode and three-tier structure mode of software development

C/S (client/server) structure, the so-called client/server structure. It is a software system architecture, through which we can make full use of the advantages of the hardware environment at both ends, reasonably allocate tasks to the client and server, and reduce the communication overhead of the system.

At present, most application software systems are two-tier structure in the form of client/server. As the current software application system is developing to a distributed Web application, both Web and client/server applications can perform the same business processing and use different modules to share logical components. Therefore, both internal and external users can access new and existing application systems, and the new application system can be extended through the logic in the existing application system. This is also the development direction of the current application system.

Although the traditional C/S architecture adopts the open mode, it is only open at the system development level, and both the client and the server need specific software support in specific applications. Because it can't provide the open environment that users really expect, C/S structure software needs to develop different versions for different operating systems, and the products are updated very quickly, so it is difficult to adapt to the simultaneous use of more than 100 LAN users. But also has high cost and low efficiency.

The three-tier client/server structure (hereinafter referred to as the three-tier model) adds a new level to the two-tier model. The model logically divides application functions into three layers: customer presentation layer, business logic layer and data layer. Customer presentation layer is a graphical interface for providing application services to customers, helping users to understand and locate application services efficiently. The business logic layer is located between the display layer and the data layer, which provides a clear level for realizing the business logic of the enterprise. At this level, the application model associated with the system is encapsulated, and the user presentation layer is separated from the database code. This layer provides the connection between the client application and the data service, and its main function is to realize the application strategy and encapsulate the application pattern, and present the encapsulated pattern to the client application. The data layer is the lowest layer in the three-tier model, which is used to define, maintain, access and update data, and manage and meet the requests of application services for data.

The main advantages of the three-tier model are:

① Good flexibility and expansibility. When the environment and application conditions are constantly changing, the goal can be achieved as long as the application layer is changed accordingly.

② Enjoyability. A single application server can provide services for customer applications of different platforms, which greatly saves development time and capital investment;

③ Better security. In this structure, the client application can't directly access the data, and the application server can not only control which data to change and access, but also how to change and access the data.

④ The repeated availability of enterprise objects is enhanced. "Enterprise object" refers to an object that encapsulates the enterprise logic program code and can perform a specific function. With the development of component technology, this reusable component model is more and more accepted by software development.

⑤ The three-tier model has become a real "thin client" with high stability, scalability and execution correction rate.

⑥ The three-tier model can centrally manage services and unify service clients, so it has good fault tolerance and load balancing ability.