[Viewpoint] RIA is a secondary revolution of the three-tier Application System

Source: Internet
Author: User

Ria(Rich Internet Application) Why? What is its significance? The popular saying is:WebApplications provide rich operation experiences and improve the friendliness of the system. This can't be wrong, but I hope to understand from another perspective: Why?RiaThe emergenceRiaWhat is the significance of multilayer applications.

 

Let's look back.ProgramThe history of layered structure development. Early programs had no concept of hierarchy. All the content, including interfaces, logic, and data, was compiled into a single execution file, as shown in:


With the development of applications, the demand for data management is getting stronger and stronger, so databases are emerging. Thus, this part of data is separated from the application and becomes independentProgramming LanguageThe Branch developed separately. The independent development of databases is the customer's/Server (C/SThe premise and necessary conditions of the architecture, from which the application develops into a two-layer structure as shown below:


Database and application separation, the application from a single layer to two layers, it is a major milestone in the development history of the layered system-I personally call it "the first social division of labor for Applications ".

 

For sure, the first time is the second time. The second major social division of labor isWebRapid development,HtmlAs a standard means to publish an application interface, the presentation layer is separated from the logic layer, and the two layers are evolved into three layers:


The second social division of labor has taken place, and layer-3 applications have become standards. Is this the end of our historical era? Should we start to look forward to the arrival of the layer-4 structure? I said no. The three-tier structure has not yet reached its head, and the revolution has not yet succeeded. comrades still need to work hard.

 

What other tasks have not been completed yet? Before answering this question, consider the question: What are the essential features of a multi-layer system? Of course, different people may have different understandings of this issue. For me, the most basic idea is: whether an application is a multi-layer application depends on whether each layer of the application has an independent alternative. In other words, replacing a layer in an application with other implementations has no impact on other layers (theoretically), or (in fact) has only a small impact. This application can be called a multi-tier application, otherwise, it is a pseudo multi-tier application. If there is a severe coupling between the layer and the layer, there is no point in layering. Never carry three layers of goat's heads and sell two or a single layer of dog meat (although dog meat is not good ).

 

Let's examine the results of the first division of labor in society from this point of view. Ask the following questions:

1. If you change the application logic layer fromJavaChangeC #(Or other languages, depending on your actual situation), can programs run? Need the database be changed??

Answer: Yes. The database does not need to be modified.

2. IfOracleChangeMySQL(Or other databases, same as above), can programs run? Does the logic layer need to be changed?

A: If the program does not rely on the unique features of a database, there is no problem. You usually need to make some modifications to the database driver and connection information. For well-configured applications, these modifications are very small.

 

From these questions, we can think that the two-layer structure is very successful and thorough, and the database and programming language are basically completely decoupled, and the database no longer depends on the programming language, programming languages are no longer dependent on databases. At the same time, I would like to emphasize that the main reason for this complete decoupling lies in the standardized database query language --SQL. Imagine if each database has its own set of completely incompatibleAPIWhat will happen? In this way, any program will be bound to a specific database, and there is no layer at all.

 

Now let's take a look at the situation on Layer 3, which also has the following problems:

If you change the business logic layer fromC #SwitchJavaDoes the presentation layer need to be modified?

 

The problem arises. In this case, it is necessary to modify allASP. NET Server ControlAll are discarded, exceptJSPDo not rewrite it. ForJavaThis is even more serious becauseJavaThe presentation layer framework can be said to be a mountain place, and each framework has its own set of syntax mechanisms. Changing a framework basically means re-engineering. This is alsoJavaCommunityWhy has it been an important reason for advocating the "No intrusion" Design Concept in the past few years-the price for switching is too high.

 

Based on this situation, we can conclude that, compared with the first large division of labor, the division of labor for layer-3 applications is incomplete and incomplete. ImageASP. NETOrJSF, Even includingRorOfRhtmlThese frameworks that use server generation technology can only be called pseudo-three-layer applications, because the presentation layer is bound to a specific backend technology and there is no chance of reuse from the backend platform. In these frameworks, the presentation layer can only be regarded as a vassal of the application logic layer, rather than an independent layer.

 

The second big division of labor is not complete yet, and the three-tier application is not complete yet. Who will initiate the second revolution to complete the unfinished business? This leads to my opinion on the title:RiaThe second revolution of the three-tier system will be completed.

 

I don't want to repeat it. Ria What are the benefits and experience? I just want to say that from the perspective of historical development, Ria The emergence of the Times is due to the lack of the last part of the three-tier structure. Slave Ria The current situation of technological development can also clearly show this trend: all modern Ria Technology, including Flash/flex , Silverlight , Ajax , Curl Among others, one of their basic commonalities is that they can be used together with any server without relying on specific background technologies. It can even be said that technologies that do not possess this characteristic should not be called Ria . (Of course, various Ria Technology is more or less prone to platforms, but achieving platform independence is no longer a difficult goal.) I also mentioned earlier that the development of multi-layer technology depends on the standard interfaces between layers, this trend is now very obvious. XML-RPC , Soap , JSON , Rest The emergence of various technologies is not in line with the historical requirements, and tries to solve the interface standard problem, laying the necessary material foundation for the final implementation of the three-layer structure.

Ajax is a special case. Although it is also called Ria, many Ajax frameworks are not easily separated from the server generation technology compared with the complete solutions such as flex and Silverlight. The concept of opoa (one page, one application) has appeared many years ago. Its core idea is not to allow servers to participate in page generation, but to use JavaScript in browsers to construct a complete application. However, the current situation shows that it is still very difficult to implement opoa using Ajax in many instances. Ajax is the biggest backend dependency in all Ria solutions. However, HTML, CSS, and JavaScript are still improving. Using some unstandardized technologies (such as Google gears) can solve most problems, and the prospect of Ajax should be worth looking forward.

The historical trend is huge and prosperous. The presentation layer is isolated from the shackles of background technology and is developed freely and independently. This is already the trend for determining the timeline. Try to bind the presentation layer to the background Implementation Technology (typical example:ASP. NETAndJSF), Even though the design is extremely subtle, after all, it is a departure from the historical development direction. Ming's The monarchy cannot cover up the disadvantages of authority. OnlyRia, I believe that the road will be wider and wider ".

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.