Duplication of efforts

The AJAX web application architecture introduces a duplication of efforts between the server side and the client side. Let's say that we wanted to add a new comment to the news article. Once we fill out the form, to add the new comment, we can initiate an XHR call, which will send the new comment, that is to be added, to the server. The server-side web application can then persist the new comment to the database, where all comments are stored. Instead of refreshing the entire web page, we can immediately update the comment section to include the new comment that was just added.

A basic tenet in computer programming, and especially in web programming, is to never trust user input. Let's consider the scenario where the user may have introduced a set of invalid characters into the comment box. We will have to implement some type of validation that checks the user's comment, both on the client side and on the server side. This means that we'll have to implement client-side form validation in JavaScript and server-side form validation in Go.

At this point, we have introduced a duplication of efforts in two programming languages spread across two different operating environments. Besides the example we just considered, there may be other scenarios that require duplication of efforts when going down this architectural path. This happens to be a major disadvantage of the AJAX web application architecture.

Wish list item #4: To increase productivity, there should be a means to share and reuse code across environments to avoid the duplication of efforts.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.170.63