A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web. Web frameworks aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse. Although they often target development of dynamic web sites, they are also applicable to static websites.
As the design of the World Wide Web was not inherently dynamic, early hypertext consisted of hand-coded HTML text files that were published on web servers. Any modifications to published pages needed to be performed by the pages' author. In 1993, the Common Gateway Interface (CGI) standard was introduced for interfacing external applications with web servers, to provide a dynamic web page that reflected user inputs.
Original implementations of the CGI interface typically had adverse effects on the server load however, because each request started a separate process. More recent implementations utilize persistent processes amongst other techniques to reduce the footprint in the server's resources and offer a general performance boost.
Although the vast majority of languages for creating dynamic web pages have libraries to help with common tasks, web applications often require specific libraries for particular tasks, such as creating HTML (for example, Jakarta Server Faces).
In the late 1990s, mature, "full stack" frameworks began to appear, that often gathered multiple libraries useful for web development into a single cohesive software stack for web developers to use. Examples of this include ASP.NET, Java EE, WebObjects, web2py, OpenACS, Catalyst, Mojolicious, Ruby on Rails, Laravel, Grails, Django, Zend Framework, Sails.js, Yii, CakePHP, and Symfony.
Types of framework architectures
Many frameworks follow the MVC architectural pattern to separate the data model into business rules (the "controller") and the user interface (the "view"). This is generally considered a good practice as it modularizes code, promotes code reuse, and allows multiple interfaces to be applied. In web applications, this permits different views to be presented, for example serving different web pages for mobile vs. desktop browsers, or providing machine-readable web service interfaces.
Push-based vs. pull-based
Most MVC frameworks follow a push-based architecture also called "action-based". These frameworks use actions that do the required processing, and then "push" the data to the view layer to render the results. Django, Ruby on Rails, Symfony, Spring MVC, Stripes, Sails.js, CodeIgniter are good examples of this architecture. An alternative to this is pull-based architecture, sometimes also called "component-based". These frameworks start with the view layer, which can then "pull" results from multiple controllers as needed. In this architecture, multiple controllers can be involved with a single view. Lift, Tapestry, JBoss Seam, Jakarta Server Faces, and Wicket are examples of pull-based architectures. Play, Struts, RIFE, and ZK have support for both push- and pull-based application controller calls.
In three-tier organization, applications are structured around three physical tiers: client, application, and database. The database is normally an RDBMS. The application contains the business logic, running on a server and communicates with the client using HTTP. The client on web applications is a web browser that runs HTML generated by the application layer. The term should not be confused with MVC, where, unlike in three-tier architecture, it is considered a good practice to keep business logic away from the controller, the "middle layer".
Frameworks are built to support the construction of internet applications based on a single programming language, ranging in focus from general purpose tools such as Zend Framework and Ruby on Rails, which augment the capabilities of a specific language, to native-language programmable packages built around a specific user application, such as content management systems (CMS), some mobile development tools and some portal tools.
General-purpose website frameworks
- Apache Wicket
- ASP.NET Core
- Ruby on Rails
- Spring MVC
- Wt (web toolkit)
- Zend Framework
Discussion forums, wikis and weblogs
Frameworks typically set the control flow of a program and allow the user of the framework to "hook into" that flow by exposing various events. This "inversion of control" design pattern is considered to be a defining principle of a framework, and benefits the code by enforcing a common flow for a team which everyone can customize in similar ways. For example, some popular "microframeworks" such as Ruby's Sinatra (which inspired Express.js) allow for "middleware" hooks prior to and after HTTP requests. These middleware functions can be anything, and allow the user to define logging, authentication and session management, and redirecting.
Web template system
Web caching is the caching of web documents in order to reduce bandwidth usage, server load, and perceived "lag". A web cache stores copies of documents passing through it; subsequent requests may be satisfied from the cache if certain conditions are met. Some application frameworks provide mechanisms for caching documents and bypassing various stages of the page's preparation, such as database access or template interpretation.
Some web frameworks come with authentication and authorization frameworks, that enable the web server to identify the users of the application, and restrict access to functions based on some defined criteria. Drupal is one example that provides role-based access to pages, and provides a web-based interface for creating users and assigning them roles.
Database access, mapping and configuration
Many web frameworks create a unified API to a database backend, enabling web applications to work with a variety of databases with no code changes, and allowing programmers to work with higher-level concepts. Additionally, some object-oriented frameworks contain mapping tools to provide object-relational mapping, which maps objects to tuples.
Some frameworks minimize web application configuration through the use of introspection and/or following well-known conventions. For example, many Java frameworks use Hibernate as a persistence layer, which can generate a database schema at runtime capable of persisting the necessary information. This allows the application designer to design business objects without needing to explicitly define a database schema. Frameworks such as Ruby on Rails can also work in reverse, that is, define properties of model objects at runtime based on a database schema.
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, while some others use rewriting techniques to translate the provided URL into one that the underlying engine will recognize. Another technique is that of graph traversal such as used by Zope, where a URL is decomposed in steps that traverse an object graph (of models and views).
A URL mapping system that uses pattern matching or rewriting to route and handle requests allows for shorter more "friendly URLs" to be used, increasing the simplicity of the site and allowing for better indexing by search engines. For example, a URL that ends with "/page.cgi?cat=science&topic=physics" could be changed to simply "/page/science/physics". This makes the URL easier for people to remember, read and write, and provides search engines with better information about the structural layout of the site. A graph traversal approach also tends to result in the creation of friendly URLs. A shorter URL such as "/page/science" tends to exist by default as that is simply a shorter form of the longer traversal to "/page/science/physics".
Some frameworks provide tools for creating and providing web services. These utilities may offer similar tools as the rest of the web application.
A number of newer Web 2.0 RESTful frameworks are now providing resource-oriented architecture (ROA) infrastructure for building collections of resources in a sort of Semantic Web ontology, based on concepts from Resource Description Framework (RDF).
- Comparison of server-side web frameworks
- Application server
- Application framework
- Application security
- Convention over configuration
- Don't repeat yourself (DRY)
- List of web service frameworks
- Rich web application (obsolete)
- List of rich web application frameworks
- Solution stack
- Mobile development framework
- Multiple (wiki). "Web application framework". http://docforge.com/wiki/Web_application_framework.
- "Top Open-Source Static Site Generators". https://www.staticgen.com/.
- "CGI: Common Gateway Interface". http://hoohoo.ncsa.uiuc.edu/cgi/intro.html.
- "CGI" (in en-us). https://www.ibm.com/docs/en/i/7.4?topic=functionality-cgi.
- "Yii PHP Framework". http://www.yiiframework.com/.
- "CakePHP". http://cakephp.org/.
- Thomson, Kris (2003-10-29). "Clarification on MVC= Pull and MVC Push". https://www.theserverside.com/discussions/thread/22143.html.
- "What are the fundamental differences between Struts and JSF". Struts.apache.org. 2011-02-14. https://cwiki.apache.org/confluence/display/WW/What+are+the+fundamental+differences+between+Struts+and+JSF.
- Microsoft. "Three-tiered distribution". http://msdn.microsoft.com/en-us/library/ff647546.aspx.
- Oracle. "clustering_concepts_10en". http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/documentation/integrator/clustering_concepts_10en.pdf.
- Robert R. Perkoski. "Introduction to Web Development". http://www.sis.pitt.edu/~perkoski/is1092/slides/chapter01.ppt.
- IBM. "Using Client Access Express in a three tier environment". http://publib.boulder.ibm.com/html/as400/v5r1/ic2933/index.htm?info/rzaii/rzaiithreetier.htm.
- Oracle. "Understanding the Three-Tier Architecture". http://download.oracle.com/docs/cd/B25221_05/web.1013/b13593/undtldev010.htm.
- Microsoft. "Pragmatic Architecture: Layering". http://msdn.microsoft.com/en-us/library/aa905336.aspx.
- Arokia. "3-Tier Web Architecture". http://www.arokiait.com/3-tire-web-architechture.htm.
- "ASP.NET MVC Controller Best Practices". http://www.arrangeactassert.com/asp-net-mvc-controller-best-practices-–-skinny-controllers/.
- Jamis Buck. "Skinny Controller, Fat Model". http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model.
- "Getting Started With Web Frameworks" (in en). Wired Magazine. https://www.wired.com/2010/02/get_started_with_web_frameworks/.
- KLIMUSHYN, Mel (6 April 2015). "Web Application Architecture – Client-Side vs. Server-Side". https://spin.atomicobject.com/2015/04/06/web-app-client-side-server-side/.
- Fowler, Martin. "bliki: InversionOfControl". http://martinfowler.com/bliki/InversionOfControl.html.
- Xue, Qiang. "Capital One Engineering – Philosophies that Shaped Successful Frameworks". http://www.capitalone.io/blog/successful-framework-philosophies/.
- "Active Record Basics". https://guides.rubyonrails.org/active_record_basics.html. "Object Relational Mapping, commonly referred to as its abbreviation ORM, is a technique that connects the rich objects of an application to tables in a relational database management system...Active Record automatically creates methods to allow an application to read and manipulate data stored within its tables."
- "Active Record Transactions". https://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html.
- "What is AJAX". https://www.dlsweb.rmit.edu.au/set/Courses/Content/CSIT/oua/cpt270/chapter/08/WhatisAJAX.html.
- Maximilien, E.M. (December 19, 2006). "Web Services on Rails: Using Ruby and Rails for Web Services Development and Mashups". IEEE Xplore (Chicago). doi:10.1109/ICWS.2006.139. ISBN 0-7695-2669-1. https://ieeexplore.ieee.org/document/4032003.
Original source: https://en.wikipedia.org/wiki/Web framework. Read more