Rich Web Clients allow developers to manage data locally and update it from the server by means of asynchronous requests, thus providing more interactive interfaces and an improved user experience. On the other hand, they face concerning challenges regarding error management. When there is a need to update the local data through multiple asynchronous requests and it is required that all them succeed, an error on a single call can lead to having incorrect information shown to the user. Consequently, developers need to explicitly implement proper recovery mechanisms, a task that most of times is complex and highly error prone, leading to tangled code and harder maintenance, especially in an asynchronous environment. These problems could be lessened through automatic error recovery techniques, but the existing state of the art for Rich Web Client development does not support recovery from asynchronous scenarios. To cope with this problem we extended the existing error recovery technique of Reconstructors, adding to it the capability of recovering the state in the presence of several asynchronous requests. We applied this technology in a widely used open source project for rendering interactive charts, ChartJs, thus allowing the developer to effortlessly guarantee that the data shown to the user, even when it results from multiple asynchronous requests, is never inconsistent. We compare our proposal to other solutions using state of the art approaches and verify that by using Reconstructors the overall implementation requires 39.16% less lines of code, and 5.66 times less lines of code are dedicated specifically to error management, while avoiding code tangling completely. Execution time showed by reconstructors is between 5.2% and 9.3% slower than other solutions, a cost we believe is worth its benefits, and feasible for using these techniques in real world client applications.
['Manuel Quintela-Pumares', 'Bruno Cabral', 'Daniel Fernandez-Lanvin', 'Alberto-Manuel Fernández-Álvarez']
Integrating automatic backward error recovery in asynchronous rich clients