Web Framework (WF) provide a standard way to build and deploy web applications. Web Framework (WF) or Web Application Framework (WAF) is a software framework that is design to support the development of web applications including web services, web resources, and web APIs.
WF aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for data access, templating frameworks and session management.Although they often target development of dynamic web sites, they are also applicable to static web sites.
A Web framework is a code library that makes web development faster and easier by providing common patterns for building reliable, scalable and maintainable web applications. After the early 2000s, professional web development projects always use an existing web framework except in very unusual situations.
Why are Web Framework useful?
Web Frameworks encapsulates what developers have learn over the past few years while programming sites and application for the web.
Framework make it easier to reuse code for common HTTP operations and to structure projects. So other developers with knowledge of the framework can quickly build and maintain the application.
Common Web Frameworks Functionality :
Frameworks provide functionality in their code or through extensions or performs common operations require to run web applications.
These common operations include :
- URL routing.
- Input form handling and validation.
- HTML, XML, JSON, and other output formats with a templating engine.
- Database connection configuration and persistent data manipulation through an Object-Relational Mapper (ORM).
- Web Security against Cross-site request forgery (CSRF), SQL Injection, Cross-site Scripting (XSS) and other common malicious attacks.
- Session storage and retrieval.
Not all frameworks include code for all the above functionality. Some Frameworks take the “batteries-included” approach where everything possible comes bundled with the framework while other have a minimal core package that is amenable to extensions provided by the other packages.
For example, the Django web application framework includes the Django ORM layer that allows a developer to write relational database read, write, query and delete operations. However Django’s ORM cannot work without significant modification on non-relational (NoSQL) databases such as MongoDB and Cassandra.
Some other web frameworks such as Flask and Pyramid are easier to use with non-relational databases by incorporating the external python libraries.
Types of Web Framework Architectures :
(1) Model-View-Controller (MVC) – Many frameworks follow the MVC architectural pattern to separate the data model with business rules from the user interface. In web applications, this permits different views to be presented, such as web pages for humans and web services.
(2) Push-based vs. Pull-based – Most MVC frameworks follow a push based architecture also called ‘action-based‘. These frameworks use actions that do the require processing, and then ‘push’ the data to the view layer to render the results.
(3) Three-tier organization : In Three-tier organization, applications are structured around three physical tiers; client, application, and database. The database is normally an RDBMS.
Features of Web Frameworks :
(1) Frameworks typically set the control flow of a program. It allow the user of the framework to “hook into” that flow by exposing various events.
(2) Web Template System : Frameworks provide web template system which is use in web publishing to allow web designers and developers to work with the web templates for the automatic generation of custom web pages, such as the results from the search.
(3) Caching : Frameworks offers Web caching which is the caching of web documents in order to reduce bandwidth usage, server load, and perceived “lag“.
(4) Security : Some web frameworks come with authentication and authorization frameworks. It enable the web server to identify the users of the application. It also restrict access to functions based on some defined criteria.
(5) Scaffolding : Scaffolding is a technique supported by some model-view-controller frameworks. It is a technique in which the programmer can specify how the application database may be use.
(6) URL mapping : A framework’s URL mapping or routing facility is the mechanism by which the framework interprets URLs. Some frameworks, such as drupal and Django, match the provided URL against pre-determined patterns using regular expressions.
(7) Web Services : Some frameworks provide tools for creating and providing web services. These utilities may offer similar tools as the rest of the web application.
(8) Web Resources : A number of newer Web 2.0 RESTful frameworks are now providing Resource-Oriented Architecture (ROA) infrastructure for building collection of resources.