Web application frameworks

Simply put, a web framework makes it easier to develop a web application. Consider the aspect of breaking down commonly used functionality into reusable modules. That is exactly what frameworks do. They come with a lot of reusable modules and enforce a standard structure for the code so that it will be easier for developers across the world to go through and understand the application.

Apart from all these advantages, web frameworks mostly get maintained by a lot of developers across the world. So, the effort of developers to incorporate the newer bug fixes and features of underlying languages is minimized to a point where we just need to upgrade the framework version which is being used by the application. So, the use of web frameworks for building web applications brings a lot of advantages to the development and maintenance phases of a web application.

The Express.js framework that we are going to use throughout this book is a Model-View-Controller (MVC) based web application framework. MVC is just an architectural design pattern:

  • Models: Models are used to represent the data or entities of the web application.
    They align more closely with the instances, which store the data of the application—typically a database or a web service.
  • Views: Views are responsible for how the application gets presented to the end user. So, a View can be considered as the presentation layer of the application.
  • Controllers: Now, you may be wondering about the role of controllers in the web application. Well, the role of controllers is to just glue together the models with the respective Views and to take care of the request from the user for a particular web page in our application end to end.

This may be a bit hard for you to grasp if you are hearing this concept for the first time. But after going through this chapter, you will get used to these concepts while we present various examples to you.

..................Content has been hidden....................

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