Transplantation from C / S to WEB
(This article is reproduced from Software Engineering Expert Network www.21cmm.com)
This paper analyzes the characteristics of C / S and web applications from the structure of the network application and its own advantages and restrictions; describes the data processing process in web applications; also describes the functional division of each part in web applications; Steps to transplant the WEB platform. Since the 1990s, the client / server (CLIENT / SERVER, hereinafter referred to as a C / S) structure replaces the original host / terminal (Host / Terminal) structure, and has played a huge role in the development of the entire IT. However, with the continuous spread and application of the Internet, the application of C / S feels that some power is not from the heart.
First, the limit of the C / S structure
Most of the network applications can be divided into the following four levels: a performance layer, a transaction layer, a data logic layer, and a data storage layer. In the C / S structure, both the performance layer and the transaction layer are placed on the client, while the data logic layer and the data storage layer are placed on the server side. This organization has a lot of restrictions: 1. The client is very large, so that it is very difficult to upgrade and maintenance, it costs very much; 2. Transaction layer cannot be shared with cross-platform clients; 3, isolated Logic components; 4, there is no unified data logic layer to provide different types of data storage layers; 5, the C / S organization does not support Internet. People who have developed and maintained by MIS under C / S structures will be quite deep: a small change in the application, they must notify or visit every client to update; new or upgrade a machine It is necessary to install the application and its related files on the client. If the entire system has thousands of clients, how big can you imagine maintenance?
Second, the solution for web applications
The web platform is a dispatch task set, customer-centric application platform; it is a platform for distributed, open, adaptive, high performance, end-to-end; it makes the company's use of technology to obtain competitive advantage.
1. The emergence of distributed C / S technology has brought concentrated information and local PC environments to the system integration scheme, but its data sharing is very insufficient. You can think about it, in C / S applications, How many people can get the information you want to release. Today's information technology requires new solutions, which offer customers-centered user interface and web distribution structure, with IT environment personal characteristics, such as data access, security, etc., this is what we usually say Three-tier structure.
2. The advantage of the Web structure In the web structure, the transaction layer and the data logic layer are placed in the intermediate component layer. This is the key and is the biggest difference with the C / S structure. It can solve the following problems: (1) Client Very thin, and it is easy to automatically upgrade at runtime; (2) The transaction layer can be shared on a cross-platform client; (3) Separation of different logical components means graphic designers, transaction logic developers and database analysts Designed separately, their own parts; (4) unified, abstract user interfaces allow users to access data more effectively from the same data source; (5) This structure can be more efficient in the enterprise internal network, international Internet Run on the outreach. The intermediate component layer acts as a server, which is the usual application server.
3. Open Web is an open environment, integrated by multiplexing components, published through standard language compilation, transf platform unified protocol, with standard user interface display, is independent of hardware platform and operating system. There are now three component models: Activ EX, JavaBeans and Corba, each model has its own communication protocol: ActiveX uses COM and DCOM, JavaBea NS and CORBA with IIOP. But not every browser supports dynamic HTML, and the Java script has supported at least three models: Active Server, LiveWire, and PowerDynamo.
4. Adaptability An adaptive development environment is very important, the purpose of the application server is to support multiple components models, but there is a stronger adaptability to the client and database server. With the intervention of web technology, user interface design has undergone tremendous changes, because at the site, there is no such thing as confusing users or user manuals. A successful site should first attract the user, and then retain the user. Introducing new, gradient and intuition user interface standards, allowing end users to communicate directly with them.
Third, the division of labor in the Web structure
1. The web publishing section is as shown above, the web server is only read from the site from the site, then sent to the client's browser in a static HTML format; you can also enhance performance capabilities, but it is only It is not to pass the page or components with ActiveX or JavaBeans without any transaction data server.
2. Web Data Processing section Web data processing enhances the capacity of standard Web site access data, including many data types. We can divide the data into two major groups according to the data access capacity: Standard Online Transaction (OLTP) programs will spend a lot of time to retrieve and operate core online data, this data requires continuous reading and backup. Another auxiliary data is read-only, such as helping files, user information, and documentation. Web data processing is mainly concentrated in auxiliary data, while web OLTP is mainly concentrated in core online data. 3. The client client is a logical layer that performs various extended HTMLs (including Dynamic HTML) pages, which are both from the browser, also from visualization JavaBeans and ActiveX components. In any case, we need at least an HT ML page, whereby HTTP can be transferred from the server to the client, and the other parts of the application can be a whole. Because most of the web applications are written for the Internet. For professional IT applications, the web is a successful platform. Users can continue working after disconnecting, which means that remote icons can access transactions. And logical data. This will not only distribute applications, but also distribute data.
4. The rest of the application and data server-side Web structure is how to complete how the application works with the data. Data can be divided into two categories: transaction logic and data logic. Data logic is resident in the data server, while transaction logic is placed in the application server. Transaction logic can be divided into two categories: transaction components and application services, transaction components define transactions and their operations, and application services are components that provide general application performance, such as menu management, master-slave data format, etc. We have already introduced the web release, web data processing and web OLTP. In fact, in a complete application, these three methods often exist. For example, a web page that does not access any data, the traditional web approach is good, and the web server reads the page from the file system and then gives the client.
Fourth, the step of transplantation
When we determine the transplant order, keep in mind the following factors: First, we must know how big the risks can you bear, thus decide how much modifications you have, second, although we pay attention to the configuration environment itself, but the development environment is crucial A complete web solution should include both parts. Five steps to port from C / S to the web platform in detail below:
1. Select the development platform for the transaction logic First, to select the component model for the development of transaction logic and the communication between the client and the application server, then determine what application server to implement transaction logic. For transaction logic, the page server is the simplest selection, but it uses dynamic data objects (ADO) or JavaBeans, or both, depending on many factors, such as current configuration, development tools And platform restrictions, etc. The communication model of the associated component is usually used, but it is not necessary to select the application server that supports multiple components. The typical is to include two types of servers: one class is an HTTP-based page server to handle web data flows; and another The transaction server is used to process web online transaction (OLTP). If the current two-layer structure is currently developing a third-generation language, you don't have to consider the legacy of legacy, because there is no application server; but if it is two-layer structure, the fourth-generation language developed application, you can use itself The application server and transaction logic extension are applications of three-layer structure. Powerbuilder and its unacceptable object offer a good development environment. Existing three-layer structural applications, whether the third generation or fourth-generation application has the application server form, you can use the old server, or go to a new server.
2. Selecting the development platform for performance logic to select the client's development environment. The requirements are more cautious, because the coordination between bandwidth and functionality is very different between different applications. In any case, select the visual components and browsers you expect. If both browsers require support, they need to write some universal programs. For application servers, the choice between ActiveX and JavaBeans is completely dependent on the development experience, strategy, and components available in the market. Caring for the current application, just like the logic of performance, see whether it is two-layer structure or three-layer structure, although the application of two-layer structure is a fertilizer client, it must be separated, but the real technology does not need to change. Only one HTML is required to start the page, reconfigure the performance logic, and allow the HTTP mechanism to access it.
3. Selecting the development environment The choice of development environments is the key to porting to the web platform, because development tools help to develop processes. You can choose a component model that meets the industrial standard, which will generate transaction logic for you, and then do not have to modify the source program to generate these components. Some tools can generate a variety of performance levels such as JavaScript, Java or ActiveX components, and more. The development environment described herein is the scope of the fourth-generation language, such tools can create a complete application in a unified, integrated environment, all performance and transaction logic are written in the same language. In the configuration phase, different components and language models are generated according to the running platform. 4. Unify and build transaction logic This must have a detailed chart for developing and configuring the environment, re-planning existing encodings. You can ignore the details of the change language and component models, but only pay attention to the logic itself. The performance logic is separated from the transaction logic and then separated from the application server from the application server. Once the transaction logic is defined, the application server can be configured. There are two ways to organize transaction logic: extract logic from data models or client applications. Some data logic stores in the current application, so you have to regenerate it as a component.
5. Reconfiguring the performance logic for the web application must reconfigure the performance logic to adapt to the browser environment, this process is quite strict, because the browser environment sends the client component to the user, there are many options. If the development environment supports general technologies, it is desire to use the best strategy in this technology, such as PowerBuildo generate HTML by DataWindow, but plans to generate more complete applications in this case. The Data Window that meets Java is considered. When the performance logic changes to a web environment, some new components need to be developed. If no new page is generated, the C / S application can be exactly the same as the user interface of the web application.