Saltar al contenido ForoHackers

Web frameworks: start here

Frameworks web
#3429 · · Citar · Denunciar

A web framework is a library of ready-made structure for building web applications: routing, templates or components, forms, database access, authentication. It gives a team a shared way of working in exchange for following its conventions. Frameworks exist for servers and for browsers, and they come and go, so learn the ideas beneath them.

Key concepts

  • Routing: mapping a URL and method to the code that handles it.
  • Templates and components: turning data into HTML on the server, in the browser, or in both.
  • Convention over configuration: sensible defaults let you skip decisions, until you need to override them.
  • Middleware and lifecycle: hooks around each request or each rendered component.
  • Inversion of control: the framework calls your code, instead of your code calling a library.

Vocabulary

  • MVC: model, view, controller, a common way to divide an application.
  • Server-side rendering: producing the HTML on the server before it reaches the browser.
  • Scaffolding: generating the starting files of a project or feature.
  • Micro-framework: a small framework that gives routing and little else.

What to study, in order

  1. Write a tiny framework yourself: a router, a template function and a request handler.
  2. Build one real app with a server-side framework in a language you know.
  3. Build the same app with a browser-side component framework and compare the effort.
  4. Read the framework's own documentation on its request lifecycle and its security defaults.
  5. Upgrade the app across a major change and see what coupling to the framework costs.

Related tags

#frontend #backend #design-patterns #architecture

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder