Web Development

Framework

A framework is a set of code, libraries and conventions that gives an application a base structure and controls its flow, so the developer only writes the part that is specific to the project.

In this post

A framework is a working structure that offers ready-made pieces and an orderly way to build a program. The word can be understood as a working frame or scaffold. Instead of starting from scratch, developers start from a proven base that already solves common tasks such as identifying users, organising a website’s addresses or saving data in a database.

A good comparison is the process of building a house. You can cut every brick and make every pipe yourself, or you can start from a prefabricated structure with the foundations, beams and connections ready. The second option is much faster and less prone to mistakes, although it forces you to respect the measurements and rules of the structure. A framework works in the same way.

A framework is the ready-assembled skeleton of an application. It saves a lot of work, but it has to be kept in good condition.

What is a framework?

The term framework is formed by combining two English words. Frame is structure or scaffolding, and work is work. It is used in many areas of technology, but in web development it refers to a set of code, tools and rules that serves as a starting point. Whoever uses it focuses on what is specific to their project, and leaves the common parts to the framework.

The difference between a framework and a library

The two are mentioned almost as synonyms, but they are not the same thing. A library is a set of functions that the developer calls when needed, and control of the program remains theirs. A framework reverses the relationship, because it sets the overall structure and it is the framework that calls the developer’s code in the expected places. This principle is known as inversion of control.

Difference between using a library and using a framework

The difference matters because it determines freedom and dependency. Switching libraries is usually manageable, but switching frameworks can mean rewriting a large part of the project. That is why it is advisable to choose carefully and to think about maintenance over several years.

The model, view and controller pattern

Many web frameworks organise code with the model, view and controller pattern, known as MVC. The model stores and manages the data, the view decides how it is displayed and the controller receives the user’s requests and coordinates the other two. Separating those three responsibilities makes it possible to change the design without touching the logic, or the database without rebuilding the screens.

How the model, view and controller share a request

Other uses of the word framework

Outside programming, framework is used for any working structure that organises a task. Scrum is a framework for agile project management, the NIST Cybersecurity Framework organises a company’s security into functions and categories, and in marketing people talk about frameworks to describe models such as the conversion funnel. In every case the idea is the same, a proven structure so you do not start from scratch.

Types of frameworks

The types of frameworks are classified according to the part of the software they help build. Within each family there are lightweight options, which leave a lot of freedom, and large opinionated ones, which decide for the developer how to do each thing.

Frontend frameworks

Frontend frameworks, such as React, Angular or Vue, make it easier to build the interface the visitor sees with reusable components, such as menus, forms and cards, which update themselves when the data changes. Angular is a complete, opinionated framework, while React defines itself as a library and is usually combined with other pieces for routing or application state.

Backend frameworks

Backend frameworks organise the server side, with user management, databases, routing and templates. Laravel and Symfony dominate in PHP, Django and Flask in Python, Spring in Java and Express in Node.js. Django, for example, includes out of the box an admin panel that is generated from the data models.

CSS frameworks

Style frameworks, such as Bootstrap or Tailwind, offer ready-made buttons, grids and design utilities. Bootstrap, created by two Twitter engineers and released in 2011, popularised the twelve-column grid that many websites still use, while Tailwind proposes combining small classes directly in the HTML.

Full-stack frameworks

Full-stack frameworks cover both the server and the interface with a coherent set of tools. Next.js and Nuxt combine React and Vue with a server that renders the pages, and Ruby on Rails lets you build an entire application without leaving the same ecosystem. It is best to choose according to the size of the project, the team’s experience and the availability of professionals who know it.

Frameworks for mobile, desktop and testing

Not every framework is designed for the web. Flutter, from Google, and React Native, from Meta, let you write a mobile app once and publish it for Android and iOS. Electron packages web technologies as desktop applications, and it is used by programs such as Visual Studio Code. And there are testing frameworks, such as JUnit or Jest, that organise how automated code checks are written and run.

What a framework is used for

Speed and order

The most obvious advantage of a framework is the time it saves. Functions that would take weeks, such as user registration with secure passwords, come ready-made and tested.

The team can devote its effort to what makes the project unique. For a company, this means lower costs and getting a product or a website to market sooner.

A framework also brings order to a team’s code. Every developer who knows the framework knows where to look for each thing, how files are named and how the code is organised. A new person can join a project quickly. And if the project changes hands, the next team recognises the structure, something very valuable when a website is maintained for years.

Built-in security

Serious frameworks include protection against the most common attacks. They filter what users type into forms, protect sessions and handle passwords properly. These are measures that an inexperienced developer might forget or get wrong if working from scratch. Thanks to this, basic security mistakes are greatly reduced in well-planned projects. That security does depend, however, on the framework being kept up to date. Its creators fix flaws discovered over time and publish new versions. If an application falls behind, it loses those protections and carries the known defects with it. It is the other side of relying on a common base, which makes community help valuable but demands maintenance discipline.

A community behind it

Popular frameworks have thousands of people behind them who review, document and improve them. There are guides, courses, forums and extensions for almost any need. When a question comes up, someone has probably already solved it. This support network is one of their great assets and a reason to prefer widely used options over little-known ones.

Large communities also detect security flaws more quickly. The more people review the code, the more likely it is that someone will find and report a problem before an attacker exploits it. It is not a guarantee, as the Struts case showed, but it is a real advantage over tools that only a handful of people know. The flip side is that fashions change. A very popular framework today can lose support within a few years, and the applications built on it are left orphaned. That is why it is wise to look at the health of the project, the frequency of its updates and who backs it before building on it something that has to last many years.

Frameworks and content management systems

A content management system such as WordPress, Joomla or PrestaShop is not a framework in the strict sense. But those who create templates and extensions rely on many reusable pieces that resemble one, and some platforms are built on top of a framework, such as Drupal and Magento on Symfony or Laravel components. It is common for a modern template to include its own options framework or to use a style framework for its design. That is why it is worth knowing what each component includes, because those pieces also need updating.

A frequent mistake is for a template or an extension to bundle a copy of an old framework that nobody updates. Even if the core of the system is kept up to date, that internal piece can carry known flaws for years. Security companies have found cases like this in very popular extensions on several platforms. Choosing actively maintained components reduces this risk.

For a website owner, the recommendation is simple. When you commission custom development, ask which framework is used, which version and who is responsible for updating it. Ask for it to be written into the contract. A website built with solid technology that is then abandoned becomes, over time, a security and cost problem that will have to be faced sooner or later.

How to judge whether a framework is a good choice

Pros and cons of working with a framework

Frameworks bring speed, order and good practices to a project. They avoid reinventing common tasks, impose a structure that makes teamwork easier and usually include protection against common security mistakes. Their community provides documentation, examples and solutions to frequent problems.

The drawbacks are a learning curve, a certain rigidity and the dependence on the project staying alive. An abandoned framework or a major update can force costly rewrites. In small projects, the added complexity can outweigh the benefit. The useful question is what real problem is being solved and whether a simpler solution would be enough. A WordPress developer knows when to use these pieces and how to integrate them without breaking what already works.

Criteria for choosing a framework

The first criterion is the health of the project. Check when its last release came out, whether it publishes fixes regularly and whether it has companies or people backing it. A framework that has not been updated for years is a warning sign, however convenient it may be. Its flaws will not be fixed, and attackers know it.

The second is how easy it is to find professionals. If only a handful of people know it, depending on them is a risk. A widely used framework ensures that, if you change teams, there will be people able to carry your project forward. This ease of handover is one of the best protections against the unexpected and against price rises from suppliers.

The third is matching it to your real needs. For a simple website, a heavy framework is overkill and makes maintenance more expensive. For a complex application, a lightweight one falls short. Ask several professionals, compare their arguments and ask them to explain what will happen in five years. A good adviser will not recommend the fashionable tool without explaining its maintenance costs. The best recommendations usually come from those who take responsibility for maintaining what they build.

A flaw in a web framework that exposed the data of millions of people

In March 2017 a serious flaw was made public in Apache Struts, a framework widely used to build enterprise web applications. Its maintainers published the fix almost at the same time. Any organisation using this tool had to apply it as soon as possible, because attackers began searching for vulnerable systems within days.

Equifax, one of the largest credit reporting agencies in the United States, had a consumer dispute application built with this technology. The update was not applied in time. The attackers got in during May and stayed inside for 76 days, according to the Government Accountability Office, querying dozens of databases and extracting information continuously.

The result was one of the largest data thefts in history. Close to 145 million people were affected, with names, dates of birth and identification numbers exposed. In December 2018, a congressional report concluded that the breach had been entirely preventable. The company ended up paying a settlement of hundreds of millions of dollars with the authorities.

The lesson is harsh but useful for any project. Choosing a good framework was not enough. You had to know it was in use, watch its advisories and update quickly. The reports pointed out that the company did not even have a reliable inventory of where it was installed. Knowing which pieces make up your website is the first step towards being able to protect it.

Many small businesses see themselves in this case without realising it. They have a custom application, built years ago by a supplier who is no longer around, and nobody knows what technology it runs on or whether it receives updates. Taking an inventory of what is used, even in a simple spreadsheet, is a modest task that greatly reduces the risk of unpleasant surprises.

History of frameworks

The idea of a reusable structure was born in object-oriented programming. In 1979 the Norwegian Trygve Reenskaug described the model, view and controller pattern while working with the Smalltalk language at the Xerox PARC research centre. In 1988 Ralph Johnson and Brian Foote popularised the term framework to describe sets of classes that an application extends rather than calls.

On the web, Apache Struts brought the pattern to Java applications in 2000. The big change came in 2004 with Ruby on Rails, created by the Dane David Heinemeier Hansson, which showed that a complete application could be built in days thanks to its conventions. Django, for Python, appeared in 2005, and in the following decade JavaScript frameworks, such as AngularJS in 2010 and React in 2013, took the same idea into the browser.

Frequently asked questions

Frequently asked questions about Framework

What is a framework?

It is a working structure that offers ready-made pieces and an orderly way to build a program. Instead of starting from scratch, developers start from a proven base, with common functions such as user handling, routing or data access.

Where does the word framework come from?

The word combines frame, which means structure, and work. In technical language around the world the original English term is almost always used without translation.

What is the difference between a framework and a library?

A library is a set of tools that you decide when to use. A framework imposes a structure and it is the framework that calls your code at the expected moments. With a library you are in charge, and with a framework you follow its rules in exchange for saving work.

What is a framework used for?

To speed up development and keep things in order. Frameworks avoid reinventing common tasks, make it easier for several people to work together and usually include security measures. They are used for websites, mobile apps, online shops and internal business services.

Is a content management system the same as a framework?

Not exactly. WordPress, Joomla or PrestaShop are management systems or platforms with a ready-made website, although they offer many reusable pieces to anyone who programs extensions. A pure framework, such as Laravel, Symfony or Django, is a base for building custom applications, without a ready-made website on top. Drupal and Magento sit halfway between the two.

What are the risks of using a framework?

The main one is dependency. If the framework has a security flaw, every application that uses it is exposed until it is updated. Another risk is being tied to its rules, which makes it harder to switch technology later on.

Which frameworks are the most used in web development?

On the frontend, React, Vue and Angular stand out. On the backend, Laravel and Symfony in PHP, Django in Python, Ruby on Rails in Ruby and Express in JavaScript. There are also full-stack ones that cover both sides. The choice depends on the size of the project, the team's experience and the availability of professionals who know the technology.

How do you choose a framework?

You weigh the size of its community, the frequency of its updates, the quality of its documentation and how easy it is to find professionals. A popular, well-maintained framework gives more peace of mind than a technically brilliant one abandoned by its creators.

Custom development with or without frameworks

I choose the right tool for what your project really needs, whether that is a content management system, a shop platform or custom development with a specific framework.

About the author

Javier Afán

WordPress developer specialised in security, WooCommerce, and hacked website recovery.

I work on WordPress from a technical angle focused on security, architecture, and the decisions that really affect a project's continuity.