International Research Journal of Engineering and Technology (IRJET)
e-ISSN: 2395 -0056
Volume: 04 Issue: 04 | Apr -2017
p-ISSN: 2395-0072
www.irjet.net
Removing the Middle Layer with React, CouchDB and Pouch.js Saurabh Manoj Machave, Nitin Srinivas k, Sachin S, Tushar Jain Department of Computer Science and Engineering The National Institute of Engineering, Mysore, India ---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract - There are various ways of developing on the
web, with thousands of frameworks destined to run on both client and server sides that hope to make the job of the developer easy with their innovative use of design and APIs (Application Program Interfaces). There are many such frameworks out there, none can be said to be the best, but simply depending on the tastes of the developers and their requirements of their project. One such use case is when the development must occur fast, yet the project must be scalable enough with use of databases, a responsive and a reactive UI/UX. In a field such a web development where there are multiple ways of writing the backend by using any method and language, and several components of the frontend that need to react in a particular way that the backend requires it to, it indeed results in a very complex equation if programmed without the right tools. Not just complex, but when we put time constraints on the development period things become even more tense. To combat such issues, the developer must equip themselves with the right tools for the job, and why are these tools the right ones? This paper explains these technicalities.
Figure 1: Model-View-Controller The middle layer is usually hosted on a server which listens to HTTP requests and responds accordingly depending on the HTTP verbs and the path along with the headers and cookies accompanying the request. It plays a crucial role in the process, which in a way it acts as a gateway for the end-user to use the services that the web application provides. But what if we did not have to write this layer at all? It would certainly save a ton of time at the least. Granted, but this notion does not imply that the code that should have gone to the middle layer should simply be ignored. To achieve similar functionality, we need that piece of code somewhere in the project. The bottom-line is that to make things simpler we simply just remove the middle layer, or to be precise (we “move” it to a different layer, which we will describe shortly).
Key Words: Developmental agility, Reactive user interfaces, HTTP, NodeJS, Pouch.js
1.INTRODUCTION In terms of an MVC (Model-View-Controller) Architecture, the middle layer in web development consists of a controller and a view rendering engine which takes parameters from the controller and renders the view. The controller acts as an interface between the database and the view, it queries the database for useful information depending on the requirement of the end user (or moreover based on the how the controller has been programmed to respond to the various events), fetches the information, parses the result, performs computation and passes it as a parameter to the Views to get rendered onto the screen of the end-user.
© 2017, IRJET
|
Impact Factor value: 5.181
React is a frontend framework created by Facebook, which is designed to bring an Object Oriented Paradigm to web development. As mentioned earlier, the web as a platform is very scattered, with separate components such as HTML, CSS and JavaScript along with the backend. React aims at integrating the HTML and JavaScript portions to make a neat reactive model which responds to changes in the structure of the Document Object Model (DOM) and user inputs. It finds a way to integrate the two components using ECMAScript 2015 (Transpiled using Babel) into the same context without getting syntactical errors. This allows users to make modifications to HTML elements with ease. The response
|
ISO 9001:2008 Certified Journal
|
Page 692