Web framework

Last updated

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. [1] Although they often target development of dynamic web sites, they are also applicable to static websites. [2]

Contents

History

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. [3]

Original implementations of the CGI interface typically had adverse effects on the server load however, because each request started a separate process. [4] More recent implementations utilize persistent processes amongst other techniques to reduce the footprint in the server's resources and offer a general performance boost.[ citation needed ]

In 1995, fully integrated server/language development environments first emerged and new web-specific languages were introduced, such as ColdFusion, PHP, and Active Server Pages.[ citation needed ]

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).[ citation needed ]

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.[ citation needed ]

Types of framework architectures

Most web frameworks are based on the model–view–controller (MVC) pattern.[ citation needed ]

Model–view–controller (MVC)

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. [5] 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.

Three-tier organization

In three-tier organization, applications are structured around three physical tiers: client, application, and database. [6] [7] [8] [9] The database is normally an RDBMS. The application contains the business logic, running on a server and communicates with the client using HTTP. [10] The client on web applications is a web browser that runs HTML generated by the application layer. [11] [12] 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". [13] [14]

Framework applications

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. [15]

General-purpose website frameworks

Web frameworks must function according to the architectural rules of browsers and protocols such as HTTP, which is stateless. Webpages are served up by a server and can then be modified by the browser using JavaScript. Either approach has its advantages and disadvantages.[ citation needed ]

Server-side page changes typically require that the page be refreshed, but allow any language to be used and more computing power to be utilized. Client-side changes allow the page to be updated in small chunks which feels like a desktop application, but are limited to JavaScript and run in the user's browser, which may have limited computing power. Some mix of the two is typically used. [16] Applications which make heavy use of JavaScript and only refresh parts of the page, are called single-page applications and typically make use of a client-side JavaScript web framework to organize the code.[ citation needed ]

Server-side

Client-side

Examples include Backbone.js, AngularJS, Angular, Ember.js, ReactJS, jQuery UI, Svelte, and Vue.js. [17]

Discussion forums, wikis and weblogs

Features

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. [18] 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. [18] 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. [19]

Web template system

Caching

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.[ citation needed ]

Security

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.[ citation needed ]

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. [20]

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. [20]

Other features web frameworks may provide include transactional support [21] and database migration tools. [20]

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, 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).[ citation needed ]

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".[ citation needed ]

AJAX

Ajax, shorthand for " Asynchronous JavaScript and XML ", is a web development technique for creating web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user requests a change. This is intended to increase a web page's interactivity, speed, maintainability, and usability. [22]

Due to the complexity of Ajax programming in JavaScript, there are numerous Ajax frameworks that exclusively deal with Ajax support. Some Ajax frameworks are even embedded as a part of larger frameworks. For example, the jQuery JavaScript library is included in Ruby on Rails.[ citation needed ]

With the increased interest in developing "Web 2.0" rich web applications, the complexity of programming directly in Ajax and JavaScript has become so apparent that compiler technology has stepped in, to allow developers to code in high-level languages such as Java, Python and Ruby. The first of these compilers was Morfik followed by Google Web Toolkit, with ports to Python and Ruby in the form of Pyjs and RubyJS following some time after. These compilers and their associated widget set libraries make the development of rich media Ajax applications much more akin to that of developing desktop applications.[ citation needed ]

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. [23]

Web resources

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).[ citation needed ]

See also

Related Research Articles

Server-side scripting is a technique used in web development which involves employing scripts on a web server which produces a response customized for each user's (client's) request to the website. Scripts can be written in any of a number of server-side scripting languages that are available. Server-side scripting is distinguished from client-side scripting where embedded scripts, such as JavaScript, are run client-side in a web browser, but both techniques are often used together. The alternative to either or both types of scripting is for the web server itself to deliver a static web page.

<span class="mw-page-title-main">Model–view–controller</span> Software design pattern

Model–view–controller (MVC) is a software design pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements. These elements are the internal representations of information, the interface that presents information to and accepts it from the user, and the controller software linking the two.

<span class="mw-page-title-main">Web application</span> Application that uses a web browser as a client

A web application is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.

Jakarta Faces, formerly Jakarta Server Faces and JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications. It was formalized as a standard through the Java Community Process as part of the Java Platform, Enterprise Edition. It is an MVC web framework that simplifies the construction of user interfaces (UI) for server-based applications by using reusable UI components in a page.

In software engineering, the terms frontend and backend refer to the separation of concerns between the presentation layer (frontend), and the data access layer (backend) of a piece of software, or the physical infrastructure or hardware. In the client–server model, the client is usually considered the frontend and the server is usually considered the backend, even when some presentation work is actually done on the server itself.

Web development is the work involved in developing a website for the Internet or an intranet. Web development can range from developing a simple single static page of plain text to complex web applications, electronic businesses, and social network services. A more comprehensive list of tasks to which Web development commonly refers, may include Web engineering, Web design, Web content development, client liaison, client-side/server-side scripting, Web server and network security configuration, and e-commerce development.

<span class="mw-page-title-main">Ruby on Rails</span> Server-side open source web application framework

Ruby on Rails is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages. It encourages and facilitates the use of web standards such as JSON or XML for data transfer and HTML, CSS and JavaScript for user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), and the active record pattern.

<span class="mw-page-title-main">Dynamic web page</span> Type of web page

A dynamic web page is a web page constructed at runtime, as opposed to a static web page, delivered as it is stored. A server-side dynamic web page is a web page whose construction is controlled by an application server processing server-side scripts. In server-side scripting, parameters determine how the assembly of every new web page proceeds, and including the setting up of more client-side processing. A client-side dynamic web page processes the web page using JavaScript running in the browser as it loads. JavaScript can interact with the page via Document Object Model (DOM), to query page state and modify it. Even though a web page can be dynamic on the client-side, it can still be hosted on a static hosting service such as GitHub Pages or Amazon S3 as long as there is not any server-side code included.

<span class="mw-page-title-main">Catalyst (software)</span>

Catalyst is an open source web application framework written in Perl, that closely follows the model–view–controller (MVC) architecture, and supports a number of experimental web patterns. It is written using Moose, a modern object system for Perl. Its design is heavily inspired by frameworks such as Ruby on Rails, Maypole, and Spring.

<span class="mw-page-title-main">TurboGears</span>

TurboGears is a Python web application framework consisting of several WSGI components such as WebOb, SQLAlchemy, Kajiki template language and Repoze.

<span class="mw-page-title-main">Aptana</span> Text editor

Aptana, Inc. is a company that makes web application development tools for use with a variety of programming languages. Aptana's main products include Aptana Studio, Aptana Cloud and Aptana Jaxer.

Scaffolding, as used in computing, refers to one of two techniques:

A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of a web browser loading entire new pages. The goal is faster transitions that make the website feel more like a native app.

In software development XRX is a web application architecture based on XForms, REST and XQuery. XRX applications store data on both the web client and on the web server in XML format and do not require a translation between data formats. XRX is considered a simple and elegant application architecture due to the minimal number of translations needed to transport data between client and server systems. The XRX architecture is also tightly coupled to W3C standards to ensure XRX applications will be robust in the future. Because XRX applications leverage modern declarative languages on the client and functional languages on the server they are designed to empower non-developers who are not familiar with traditional imperative languages such as JavaScript, Java or .Net.

ZK is an open-source Ajax Web application framework, written in Java, that enables creation of graphical user interfaces for Web applications with little required programming knowledge.

Mustache is a web template system. Mustache is described as a logic-less system because it lacks any explicit control flow statements, like if and else conditionals or for loops; however, both looping and conditional evaluation can be achieved using section tags processing lists and anonymous functions (lambdas). It is named "Mustache" because of heavy use of braces, { }, that resemble a sideways moustache. Mustache is used mainly for mobile and web applications.

Mojito is an environment agnostic, Model-View-Controller (MVC) web application framework. It was designed by Ric Allinson.

<span class="mw-page-title-main">Sails.js</span> Open-source web framework built on Node.js

Sails.js is a model–view–controller (MVC) web application framework developed atop the Node.js environment, released as free and open-source software under the MIT License. It is designed to make it easy to build custom, enterprise-grade Node.js web applications and APIs. Emulating the MVC architecture of other frameworks, like Ruby on Rails, it offers similar pattern and familiarity, reducing the cognitive burden when switching between other frameworks/languages.

The following outline is provided as an overview of and topical guide to web design and web development, two very related fields:

References

  1. Multiple (wiki). "Web application framework". Docforge. Archived from the original on 2015-07-23.
  2. "Top Open-Source Static Site Generators". StaticGen.
  3. "CGI: Common Gateway Interface". Archived from the original on 2009-04-09.
  4. "CGI". www.ibm.com. Retrieved 2021-05-07.
  5. Thomson, Kris (2003-10-29). "Clarification on MVC= Pull and MVC Push" . Retrieved 2007-07-29.
  6. Microsoft. "Three-tiered distribution" . Retrieved 2011-09-19.
  7. Oracle. "clustering_concepts_10en" (PDF). Retrieved 2011-09-19.
  8. Robert R. Perkoski. "Introduction to Web Development". Archived from the original on 2013-11-07.
  9. IBM. "Using Client Access Express in a three tier environment" . Retrieved 2011-09-19.
  10. Oracle. "Understanding the Three-Tier Architecture" . Retrieved 2011-09-19.
  11. Microsoft. "Pragmatic Architecture: Layering" . Retrieved 2011-09-19.
  12. Arokia. "3-Tier Web Architecture" . Retrieved 2011-09-19.
  13. "ASP.NET MVC Controller Best Practices". Archived from the original on 2011-10-11. Retrieved 2011-09-19.
  14. Jamis Buck. "Skinny Controller, Fat Model". Archived from the original on 2015-05-16.
  15. "Getting Started With Web Frameworks". Wired Magazine . Retrieved 2018-04-02.
  16. KLIMUSHYN, Mel (6 April 2015). "Web Application Architecture – Client-Side vs. Server-Side". Atomic Spin. Retrieved 2016-03-06.
  17. "AngularJS vs. Backbone.js vs. Ember.js". www.airpair.com. Retrieved 2016-06-04.
  18. 1 2 Fowler, Martin. "bliki: InversionOfControl". martinfowler.com. Retrieved 2016-03-06.
  19. Xue, Qiang. "Capital One Engineering – Philosophies that Shaped Successful Frameworks". www.capitalone.io. Retrieved 2016-03-06.
  20. 1 2 3 "Active Record Basics". Ruby on Rails. Retrieved March 20, 2021. 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.
  21. "Active Record Transactions". Ruby on Rails. Retrieved March 20, 2021.
  22. "What is AJAX". www.dlsweb.rmit.edu.au. Retrieved 2021-05-07.
  23. Maximilien, E. M. (2006). "Tutorial 4: Web Services on Rails: Using Ruby and Rails for Web Services Development and Mashups". 2006 IEEE International Conference on Web Services (ICWS'06). pp. xliii. doi:10.1109/ICWS.2006.139. ISBN   0-7695-2669-1.