The first part: several typical application models
What the application is, simply speaking, is the problem domain of the human objective world in the computer World solution. We live in an objective world of complex and diverse, the computer world is also profound, how to express the universal meaning of the application is a very useful topic. The programming model of an application, the topology of an application, is a science about applications. People who are engaged in software design and software development will benefit if they can pay enough attention to the programming model of the application.
Introduction
A brief introduction to the development of the application programming model, as well as several of our common application programming models. Through the description of multiple models, the concept of programming model is deepened, which lays a foundation for further describing the Web application model below,
1, the basic function of the application unit
The functional code and its resources that make up the application, in accordance with its functionality in the application, can be easily decomposed into three parts: the user interface (users Interface), transaction logic (Business Logic), and data access. The basic functional unit of the application is shown in Figure 1.
Figure 1, Application function decomposition
2. Several typical programming models
With the development and application of computer technology, the programming model of application has been evolving, which has emerged: Single-layer Application Model (monolithic), two-tier client/server application model (Two-tier client/server), Multilayer application model (multitier Client/server); Distributed system, multilayer application model based on Web (web-based multitier client/server).
Single-layer Application model
Early applications written for mainframe did not separate the three components of the application, that is, the user interface, transaction logic, and data access were not separated. This architecture is related to the computer level and application at the time, when users share mainframe resources through dumb terminals, dumb terminals do not have any processing power, and all user interfaces, transaction logic, and data access functions are implemented on mainframes. This makes it reasonable to use a single layer architecture without a multi-tier architecture. The single tier application structure is shown in Figure 2.
Figure 2, one-tier application model
Two-tier client/server application model
The advent of the PC has brought tremendous impetus to the development of the application model, when a client-server-mode application appears, that is, the application's code and resources are clearly divided into client and server side. Because the PC has some processing power, the traditional user interface and part of the transaction logic implemented on the mainframe are moved to the PC (we refer to this PC-side code as the application client). The mainframe provides some of the transaction logic and data access functions (we call this mainframe-side code the application server side). With the increasing of PC processing ability, the task of the client is increasing gradually, and the hardware requirement of the server is gradually decreasing.
Depending on how the transaction logic is allocated on both the client and server side, the model has several forms shown in Figure 3.
Figure 3, three forms of two-tier client/server application models
It is important to note that client/server applications are often reflected in the client and server side running on different computers, but this is not necessarily the requirement that client/server applications can be implemented on the same computer.