Leanpub Header

Skip to main content

Crea API che non odierai

Ormai tutti vogliono utilizzare le API quindi é decisamente una buona idea imparare a costruirle.

Hai ricevuto l'incarico di costruire un'API per la tua azienda ma non sai da dove cominciare? Hai rilevato un' API scritta da qualcun altro e la odi? Hai scritto una tua API e la odi comunque? Questo libro fa per te

This book is a translation into Italian of Build APIs You Won't Hate which was originally written in English

The authors are letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
145
Pages
32,916Words
About

About

About the Book

Costruisco API da molto tempo ed é un'attivitá sempre piú comune per gli sviluppatori lato server grazie alla crescita di framework JavaScript per l'interfaccia grafica (front-end), di applicazioni per iPhone e di architetture API-centriche. Se da un lato si sta solo prendendo roba da un'origine dati per spararla in uscita come JSON, dall'altro sopravvivere ai cambiamenti nella business logic, agli aggiornamenti dello schema del database, alle nuove funzionalità o alla obsoloscenza degli endpoint, ecc... diventa molto difficile.

Trovo che la maggior parte delle risorse in cui mi sono imbattuto siano terribilmente carenti o specificamente finalizzate a un unico framework. Molti tutorial e libri usano mele e pere come esempi e quindi non sono abbastanza concreti, o parlano come se /users e /users/1 siano i soli endpoint di cui si abbia bisogno. Ho passato l'ultimo anno di lavoro in una società chiamata Kapture dove la mia funzione principale è stata quello di ereditare, ricostruire, mantenere e sviluppare una vasta API dotata di moltissimi endpoints diversi che espongono un sacco di diversi use-case.

L'API in questione era alla versione 2 quando sono entrato in azienda ed era scritta in FuelPHP, utilizzando un ORM ormai deprecato che era stato pesantemente modificato dallo sviluppatore originale. Kapture era in fase di ricostruzione della propria applicazione iPhone per implementare nuove funzionalità, quindi ho usato questa opportunitá per sistemare un po´ di casino e costruire la versione 3 con Laravel 4, facendo leva sui suoi semplici meccanismi di Routing (inizialmente basati su Symfony ), Migrazione di database, Schema, Seeding, ecc. Ora stiamo facendo la stessa cosa per la versione 4 ma questa volta non è stato necessario riscrivere nulla, anche se ci sono alcune nuove funzionalità, e la versione 3 è stata forcata (forked) in una nuova (v4) ed entrambe sono attivamente sviluppate e vivono fianco a fianco sugli stessi "API" server. 

Attraverso buone pratiche ed buoni consigli generali, potrai partire al volo con lo sviluppo di API, anche se sei nuovo in questo ambiente. D'altra parte, leggendo alcune storie dell'orrore che riporto (e come sono state superati/evitati/scongiurati certi errori) puoi sperare di evitare molte delle insidie in cui mi sono imbattuto o in cui ho visto cadere altri. Il libro discuterà la teoria della progettazione e della produzione di API in qualsiasi linguaggio o framework. La teoria verrá descritta attraverso esempi scritti prevalentemente in PHP ma anche in Ruby e Python. Questo libro, comunque, non sará troppo incentrato sul codice perché, diciamolo, leggere codice non é poi cosí divertente.

Al termine di questo libro riuscirai a costruire un'API che sa creare, leggere, aggiornare, eliminare, elencare, cercare e che sa fare quant'altro una buona API RESTful deve saper fare.

Il libro coprirá anche altri argomenti piú avanzati come il  testing degli endpoint, il debugging, gli embedded data objects in modo coerente e scalabile, l'impaginazione delle risposte (compresi gli embedded objects) e i collegamenti (links) di tipo HATEOAS. 

Se hai dei suggerimenti o dei commenti non esitare a metterti in contatto.

Share this book

This book is a translation into Italian of Build APIs You Won't Hate which was originally written in English

Price

Pick Your Price...

Minimum price

$25.99

$28.99

You pay

$28.99

Authors earn

$23.19
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 2)

2
The author will earn $24.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Authors

Phil Sturgeon

Since 2010 I've worked as a freelancer, consultant, API lead, and CTO for several API-centric technology startups. Working as an internal API consultant for WeWork gave me a lot to write about, where I used my experience of things going horribly horribly wrong to help educate developers, define standards for API design and architecture, and implementing full API design lifecycles so we weren't all just building nonsense and hoping it was useful.

Trying to get loads of different questionably built APIs tidied up, playing nicely, and working quickly was a constant source of learning for me and everyone involved. I took a lot of that learning to Stoplight, and helped plan, build, and manage most of your favourite OpenAPI tools.

When I'm not banging on about APIs I'm riding, racing, or crashing various bikes, or saving the plant through Protect Earth, an environmental charity I co-founded in 2020. We create brand new woodlands, restore and extend ancient woodlands, and run around with machetes getting rid of invasive species.

Leanpub Podcast

Episode 292

An Interview with Phil Sturgeon

Damiano Venturin

I'm a linux man and a php developer. I like cross-cultural environments: who knows me well also knows what I mean. This is why, for now and occasionally, I translate books from english to italian.

Sono un utente linux ed uno sviluppatore php. Mi piacciono gli ambienti multiculturali: chi mi conosce bene sa cosa intendo. Per questo motivo, ogni tanto, traduco libri dall'inglese all'italiano.

twitter: @damko

Contents

Table of Contents

  • Introduzione
  • Codice di Esempio
  • 1 Popolare proficuamente il database (database seeding)
    • 1.1 Introduzione
    • 1.2 Il Database seeding
    • 1.3 Come costruire i Seeders
    • 1.4 Questo è tutto
    • 1.5 Dati Secondari
    • 1.6 Quando eseguire il seeding?
  • 2 Pianificare e Creare Endpoints
    • 2.1 Requisiti Funzionali
    • 2.2 Teoria degli Endpoint
    • 2.3 Pianificare gli endpoint
  • 3 Input e Output: Teoria
    • 3.1 Introduzione
    • 3.2 Richieste (Requests)
    • 3.3 Risposte (Responses)
    • 3.4 Formati supportati
    • 3.5 Struttura del contenuto
  • 4 Codici di stato , errori e messaggi
    • 4.1 Introduzione
    • 4.2 Codici di stato HTTP
    • 4.3 Codici di errore e messaggi di errore
    • 4.4 Errore o errori
    • 4.5 Insidie frequenti
  • 5 Test degli Endpoint
    • 5.1 Introduzione
    • 5.2 Concetti e strumenti
    • 5.3 Installazione
    • 5.4 Inizializzazione
    • 5.5 Caratteristiche
    • 5.6 Scenari
    • 5.7 Preparare Behat
    • 5.8 Esecuzione di Behat
  • 6 Output dei dati
    • 6.1 Introduzione
    • 6.2 Approccio diretto
    • 6.3 Trasformazioni con Fractal
    • 6.4 Nascondere i cambiamenti di schema
    • 6.5 Output degli errori
    • 6.6 Test dell’output
    • 6.7 Compiti a casa
  • 7 Relazioni tra i dati
    • 7.1 Introduzione
    • 7.2 Sotto-Risorse
    • 7.3 Array di chiavi esterne (foreign keys)
    • 7.4 Documenti Composti (detto anche Side-Loading)
    • 7.5 Embedded Documents (a.k.a Annidamento - Documenti Incorporati)
  • 8 Debug
    • 8.1 Introduzione
    • 8.2 Debug a riga di comando
    • 8.3 Debug via browser
    • 8.4 Debug di rete
  • 9 Autenticazione
    • 9.1 Introduzione
    • 9.2 Quando é utile l’ autenticazione?
    • 9.3 Diversi approcci all’autenticazione
    • 9.4 Implementazione di un Server OAuth 2.0
    • 9.5 Dove vive un Server OAuth 2.0
  • 10 Paginazione
    • 10.1 Introduzione
    • 10.2 Paginator
    • 10.3 Offset e cursori
  • 11 Documentazione
    • 11.1 Introduzione
    • 11.2 Tipologie di documentazione
    • 11.3 Scegliere uno strumento
    • 11.4 Configurazione di API Blueprint e Aglio
    • 11.5 Imparare la sintassi dell’API di Blueprint
    • 11.6 Richieste
    • 11.7 Risposte
    • 11.8 Approfondimenti
  • 12 HATEOAS
    • 12.1 Introduzione
    • 12.2 Negoziazione del contenuto
    • 12.3 Controlli hypermedia (ipermediali)
  • 13 Versioning dell’API
    • 13.1 Introduzione
    • 13.2 Diversi approcci al versioning dell’API
    • 13.3 Chiedi agli utilizzatori
  • Conclusione
  • Approfondimenti

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub