# Framework

> A ready-made skeleton for an app: it sets the structure and calls your code.

- Level: Intermediate
- Topics: Software
- URL: https://tidbit.legios.com.ar/framework/
- In Spanish: [Framework](https://tidbit.legios.com.ar/es/framework/)

A **framework** is a large body of ready-made code that gives an application its basic structure, so programmers only write the parts that are unique to their product. A web framework, for example, already knows how to receive requests, read forms, talk to a database and send pages back; you fill in what your pages show and what your rules are.

The key difference with a software library is who is in charge. You call a library when you need it, like grabbing a tool from a drawer. A framework calls you: it runs the main loop and invokes your code at the right moments, such as "when someone opens this page, run this function". Engineers call this **inversion of control**.

Well-known examples include Angular and Vue for building user interfaces in the browser, Django and Ruby on Rails for web backends, and Spring for business software in Java. Choosing one is a big decision, because it shapes how the whole project is organized and is hard to swap later. In exchange, teams get a lot done fast and follow conventions that new members already know.

## An analogy

The frame of a prefabricated house: walls, roof and plumbing paths are already in place. You choose the paint, the kitchen and the furniture, but you cannot easily move a load-bearing wall.

## Keep in mind

- Provides the structure of an app; you fill in the specific parts.
- It calls your code, unlike a library, which you call.
- Examples: Angular, Vue, Django, Ruby on Rails, Spring.
- Saves a lot of work, but is hard to replace once chosen.

## Go deeper

- [Introduction to client-side frameworks (MDN)](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Frameworks_libraries/Introduction)
- [Software framework on Wikipedia](https://en.wikipedia.org/wiki/Software_framework)

## Related terms

- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
- [Software library](https://tidbit.legios.com.ar/software-library/): Ready-made code for a common task that programmers plug into their own programs.
- [Web browser](https://tidbit.legios.com.ar/web-browser/): The app that fetches web pages from the internet and draws them on your screen.
