Three-layer CS structure and its application development

zhaozj2021-02-08  369

Three-layer C / S structure and its application development

(This article is reproduced from Software Engineering Expert Network www.21cmm.com)

First, the basic hardware structure of the three-layer C / S

The traditional Layer C / S structure has the following limitations: 1 It is a single server and is centered on a local area network, so it is difficult to extend to large enterprise wide area network or Internet; 2 is limited by suppliers; 3 soft, hardware combination and The integration capacity is limited; 4 is difficult to manage a large number of clients. Therefore, the three-layer C / S structure came into being.

The three-layer C / S structure is to divide the application function into a representation layer, a functional layer, and a data layer. Its solution is: the three layers are clearly divided and logically make them independent. The original data layer has been independent as DBMS, so the key is to separate the representation layer and functional layers into their own independent programs, and make the interface between the two layers.

The method of loading the above three-layer function into the hardware is basically three (as shown in Figure 1). The representation is configured in the client, and the data layer is configured in the server.

Generally, it is only configured in the client as shown in FIG. 1 (1) or Fig. 1 (2). If the functional layer is also placed in the client like Fig. 1 (3), the maintenanceability of its program is much better than the two-layer C / S structure, but other problems are not resolved. The client's load is too heavy, and the data required for its business handles should be transmitted from the server to the client, so the performance of the system is easier to become. If the functional layer and the data layer are placed in different servers (as shown in FIG. 1 (2)), data transmission is also required between the server and the server. However, since the three layers in this form are placed on their different hardware systems, the flexibility is high, and the increase in the number of clients and changes in the processing load can be adapted. For example, when adding new business processing, a server that is loaded can be added accordingly. Therefore, the greater the system scale, the more significant advantages of this form. It is worth noting that the communication efficiency between the three-layer C / S structure is not high, even if the hardware capacity allocated to each layer is strong, it does not meet the required performance as a whole. In addition, it is necessary to carefully consider the three-layer communication method, communication frequency, and data amount. This is the key issue of three-layer C / S structure as the independence of each layer.

Second, three-layer C / S function

1. Represents layer representation layer is the user interface portion of the application, which is responsible for the dialogue between users and applications. It is used to check the data input from the keyboard, display the data of the application output. To operate intuitively for users, it is generally necessary to use a graphical user interface (GUI), easy to operate, easy to use. When changing the user interface, simply rewrite the display control and data check programs without affecting other two layers. The contents of the inspection are limited to the form of data and the range of values, excluding processing logic on the service itself. The structure of the graphical interface is not fixed, which makes it easy to change flexibility in the future. For example, in one window is not placed in several functions, but press the function segmentation window to make the function of each window simply simple. Program development in this layer is mainly to use visual programming tools.

2. Functional layer function layer is equivalent to the body of the application, which is logically in the program for specific business processing. For example, the contract amount is calculated when making a subscription contract, configuring data according to a custom format, prints the order contract, and processing the required data to be obtained from the representation layer or data layer. Data interaction between layers and functional layers should be as simple as possible. For example, when the user retrieves the data, it is necessary to simultaneously transmit information about the retrieval requirements to function (see FIG. 2), and the retrieval result data processed by the functional layer is also transmitted to the representation layer. In the application design, it is necessary to avoid "a business handling, a clumsy design of multiple data exchange between the representation layer and functional layers. Typically, in the functional layer contains: confirming the functionality of the user's application and data inventory, the function of the logging system processing the log. Most programs of this layer are developed with visual programming tools, as well as using COBOL and C language.

3. The data layer data layer is DBMS and is responsible for managing reading and writing to database data. DBMS must quickly perform updates and retrieves of data. The current mainstream is the relational database management system (RDBMS). Therefore, it is generally transmitted from the functional layer to the data layer to use the SQL language.

Third, the advantages of three-layer C / S structure

1. Having flexible hardware systems make up hardware that can be adapted to each layer can be selected to process load and processing characteristics. This is a problem with system scalability. For example, it is initially used as a server as a server, and the data layer and function layer are configured on this server. As the business development, the number of users and data increases, the Unix workstation can be used as a dedicated server for the functional layer, and a server dedicated to the data layer can be added. If the business is further expanded, the number of users further increases, and the number of servers of the function layer can be continued to divide the database. Clear, reasonably divide the three-layer structure and make it independent, which makes the system make changes very simple. Therefore, the application being divided into three layers is basically no correction. 2. Improve the maintenance of the maintenanceable three-layer C / S structure, the layers of the application can be diverted in parallel, and each layer can also be selected for their most suitable development languages.

3. It is conducive to changes and maintenance applications for application technical specifications because of layer segmentation, the processing logic of each program is very simple.

4. The more important applications of strict security management, the more important use of users' identification and access rights are more important. In the three-layer C / S structure, the mechanism that identifies the user is constructed in layers, and the access rights to the application and the data can be set by layer. For example, even if the external intruder breaks through the safety line of the representation, if there is another security mechanism in the functional layer, the system can prevent intruders from entering other portions.

In addition, the system management is simple, supporting the heterogeneous database, has high availability.

Fourth, three-layer C / S development development

Development of three-story C / S application must comply with the following principles: Protection has been investment; reduce the risk of application systems; meet current urgent needs; consider future development planning. The development of the three-layer C / S application system must be: rich features and high availability; functions must be able to cross-use system; system can be able to run across platforms. Ms. Jeri Edwards, US BEA System Co., Ltd. Product Plan and Strategic Vice President, and a typical development type of three three-layer C / S application system. New Application System Type (Greenfield), such as the British Labor Market System; enhances TurboCharger, such as AppleOrder Global Systems of Apple; Integrated Integration Existing System Type (Integrator), such as AT & T Zenith Application system. Ms. Jeri Edwards summarizes the "Gold 10 Principles" of the C / S application system in accordance with the development experience and lessons of the three-story C / S application system: (1) Try to simplify the project and make the project easy to manage. An initial system should be built as soon as possible and put it as soon as possible. When the project size is large, it can be split into subprojects that are taken by smaller development groups. (2) It is necessary to spend energy on design. The first thing to completely figure out "demand" and build a prototype to test the "weak" link in the design. Later, increased features or components should be guaranteed to be compatible with the system structure. (3) It is necessary to pursue "brought theism". Recently, there are many commercially available C / S products that can be purchased. It is necessary to adhere to the principle of "buying and buy, for me". If necessary, the system can be modified after bought, including both the basic components including applications. (4) Strictly abide by the industry standards. (5) Using the TP Monitor or Object Transaction Manager, OTM. (6) To step by step. Get user feedback; ensure the good connection between the projects; (7) In the application development process, system management cannot be ignored. (8) Repeated testing, including user trust testing, reference testing, system testing, performance testing, system integration test, rugged test, service delivery test, etc. (9) Develop a reasonable engineering schedule. (10) Develop a complete system expansion plan, including user training and technical support, efficient hard software loading, existing data and smoothing migration.

V. Core in the three-layer C / S application

Each C / S environment uses some form of middleware from the smallest LAN environment to the super network environment. In fact, regardless of when the client sends a request, no matter when it applies the access database file, there is a form of middleware to pass the C / S link, to eliminate communication protocols, database query languages, applications Logic and potentially incompatible issues between operating systems. The middleware is the most important part in the C / S environment. The so-called middleware is a software layer defined with API, which is a distributed software management framework with powerful communication capabilities and good scalability. Its function is to transmit advanced communications between clients and servers or servers and servers, and "bond the client group and server group organically". Its workflow is: When the application in the client needs to reside a server or service of a server on the network, the C / S application searching for this data will access the middleware system, which will look up the data source or service. And then send it back to the application after sending the application request. The TP monitor plays an increasingly important role in the middleware technology, especially in the three-layer C / S system. According to Standish Group, the TP monitor is one of the most popular technologies in the near two years of information industry. In 1996, 57% of key applications were built on the TP monitor. The TP monitor is good at providing transactional semantics, allowing programming on environmental speed and reliability. As a middleware, the TP monitor provides an API for writing a distributed application, which typically contains a strong management tool. The TP monitor is a high performance, high concluded, multi-user's fast response software operating environment, which can effectively manage a large number of concurrent tasks, thereby increasing the utilization of system resources. If the TP monitor is used, the total investment of the system can save more than 30%, and the development cycle can be reduced by 40% to 50%. The three-story application systems of most input applications are equipped with a transactional monitoring system. BEA Tuxedo is currently the most widely used transaction processing monitoring system. BEA Tuxedo is an intermediate infrastructure for distributing computing, which enables open application systems with high scalability, high flexibility, and high maintenanceability. It not only has functions of distributed transaction processing and inter-network communication, but also has a series of extremely perfect services to help companies build and run application systems to enable developers to build applications across multiple platforms, databases, and operating systems. program. In this way, the operation platform can be flexibly adapt to the application environment. It has the following features: 1, support a variety of hardware and software platforms. Fully compliant with Open Group's X / Open standard, support TCP / IP protocol, support more than 70 hardware platforms and operating systems including UNIX, Windows NT, AS / 400, and large-scale dedicated systems. 2, the structure is open, flexible. The module structure is centered on the advanced program interface ATMI (Application-Troom Transaction Manager Interface), rich in ATMI functions available. 3, open online transaction processing. It can provide functions such as transactional semantics, transparent branch submission, transaction records, and distributed transaction management structures. 4, combined with DCE. Through a set of tools and libraries, organic binding of the distribution computing environment DCE of the Open Group organization is implemented. 5, rich in function, including: application management; event agent; provide security guarantee for customers through authentication services, authorization services and data encryption services; support for COBOL languages; application dynamic adjustment, load balancing, etc. .

Sixth, three-layer C / S structure application status

At present, the application developed with the three-layer C / S structure is not too much, but the number is indeed increased daily. Figure 3 shows the application development form of North American operation. The ratio of three-story C / S application was 5% in 1995, an increase of 7.8% in 1997, which is expected to account for 22.9% in 1999. Layer 2 C / S type application and an additional GUI type application on the original system are positioned to be overlapped to three-layer C / S type transformation. As far as it is, this proportion of morphology is higher than that of the three layers of C / S, and it is going to last. So, under what circumstances should I use three-layer C / S? According to the survey of Gartner Group, the application with the following characteristics should consider using three-layer C / S.

1, the application is exceeded 50; 2. Application is written in different languages; 3, more than two heterogeneous data sources, such as 2 different DBMS or 1 DBMS and 1 file system; 4, The life cycle of the application is more than 3 years; 5, high workload, such as more than 50,000 transactions per day, or access to the same database of more than 300 in the same system; 6, there is a vital application internal communication, including like Internal communication of electronic data exchange (EDI). From traditional host / terminal type to three-layer C / S, it is necessary to consider time and cost issues, and some occasions are not suitable and need to be graduated.

转载请注明原文地址:https://www.9cbs.com/read-596.html

New Post(0)