A web framework (also known as a web application framework , WAF or WF for short ) is software that is designed for the development of dynamic websites , web applications or web services . Repetitive activities are simplified and the reuse of code and self-documentation of software development are promoted. Concepts such as Don't repeat yourself , KISS or convention before configuration offer simple, clear structures that can be maintained with little effort.
Often used functions such as mailing, secure authentication and authentication , security functions , localization , performance (e.g. HTTP caching ) or basic functions for web forms are provided by the framework through predefined and ready-made classes .
Web frameworks are designed to create web applications that can run very quickly. In addition, today's web frameworks offer database access, templating mechanisms, a clean separation of presentation and code by using the Model View Controller or Model View Presenter as an architectural model , and often also options for rapid prototyping through scaffolding .
Most web frameworks offer database access , mostly via an object-relational mapping . For easy handling, there is often an object-relational mapper that takes care of persistence and offers ready-made classes for use. This can be done explicitly, e.g. B. in Django , or even implicitly via introspection , such as. B. Ruby on Rails .
An existing database that has already been written to with data cannot simply be replaced like the software itself. Many web frameworks offer migrations , subroutines that adapt the database structure, in order to automatically carry out necessary database changes.
Database access from the GUI is generally considered controversial in IT. The strict layer architecture with three layers that is often encountered , for example, generally prohibits access from the presentation layer to the persistence layer. The MVC pattern, which is often used in web frameworks, does not allow database access from the GUI (but only via the model).
A web framework usually also offers the option of controlling the display via a template engine . For this purpose, HTML pages are generated on request and filled with the dynamic content. At this point, a distinction can usually be made between static and dynamic content, so that, for example, a designer determines the appearance by creating a template, which the application developer then fills with data. The syntax of the template languages is mostly based on HTML or extends it only slightly.
Scaffolding (in German scaffolding) supports the developer by generating CRUD pages (Create-Read-Update-Delete) during development and prototyping . This makes it possible to offer a web interface directly from the draft of a model, via which data can be entered and managed immediately in the database. In this way, you can develop and test with sample data. The administration views (admin interface) of a web application can partly be generated with scaffolding, as these often only require basic operating elements.