Contact

What is Software Framework?

Definition

A software framework is reusable infrastructure that provides an application's skeleton, control flow and conventions, while developers plug their own code into defined extension points. Your code calls a library; a framework calls your code. This principle is known as inversion of control. Laravel, Django, Spring and Next.js are widely used examples.

Also known as: framework, web framework, library, software library, application framework

Software framework providing routing, ORM, auth, templates and CLI as a ready structure that calls the developer's own code

You call a library; a framework calls you

The quickest way to tell a framework from a library is to ask who is in control. A library is a toolbox you reach for when you need it, and you drive the program's flow. With a framework, the framework drives: it receives the request, routes it, calls the piece you wrote at the right moment and sends the result back.

// Library: you call it to format a date
import { format } from "date-fns";
const label = format(new Date(), "yyyy-MM-dd");

// Framework: Next.js discovers this file and runs it
// whenever a request for /about arrives
// app/about/page.tsx
export default function About() {
  return <h1>About us</h1>;
}

Nothing in your code calls About. Where the file lives and what it exports decide when the framework runs it.

Inversion of control in practice

The principle is often summarised as “don't call us, we'll call you”. It shows up in a few familiar shapes:

  • Convention-based routing. A file name or route definition decides which code handles which URL.
  • Lifecycle hooks. You write code to run when a component mounts, before a record is saved or after a request completes; the framework decides when.
  • Dependency injection. A class does not create its own database connection or mail service; the framework supplies them, which makes testing and swapping parts easier.
  • Middleware. Cross-cutting concerns such as authentication, logging or CSRF protection are chained in front of every request.

Kinds of web frameworks

KindWhat it handlesExamples
Backend frameworkHTTP handling, data access, sessions, securityLaravel, Django, Ruby on Rails, Spring, Express
Frontend frameworkUI and state in the browserAngular, Vue, Svelte
Meta-frameworkAdds routing, server rendering and builds on top of a UI libraryNext.js, Nuxt, SvelteKit
CSS frameworkPrebuilt styles and utility classesBootstrap, Tailwind CSS

The boundaries blur. React officially calls itself a library for user interfaces and is usually paired with a framework such as Next.js for routing and server rendering. Vue presents itself as a progressive framework that can power one widget or an entire application. Minimal frameworks like Express impose few rules and leave most decisions to you.

What you gain and what you give up

A framework ships the parts every project would otherwise rebuild, such as routing, validation, sessions and data access, and gives a team a shared vocabulary: a Django developer knows where to look in someone else's Django project. Mature frameworks also come with secure defaults like output escaping against XSS and CSRF protection.

The price is real, too. Stepping outside the framework's conventions gets awkward, and major version upgrades take effort that, if postponed, turns into technical debt. The framework and its plugins add a long chain of dependencies. Abstractions leak as well: fixing performance problems often means understanding what happens underneath.

Questions for choosing one

  • Does the team know the framework and its language, and can you hire for it?
  • Are there long-term support releases and a clear security update policy?
  • What does the project actually need: a content-heavy site, an interactive dashboard, or an API?
  • Does your hosting support the runtime the framework requires?
  • Does the ecosystem cover the integrations you will need?

If what you need is ready-made tooling for a particular service rather than a structure for your application, you are probably looking for an SDK.

Related terms

← Back to the glossary