Come scrivevo nel mio precedente post, mi sono imbattuto in Mean Fiddler cercando dei tool free per NHibernate o che lo utilizzassero come soluzione O/RM. legendo la descrizione (a REST-style data service for .Net similar to the Microsoft project codenamed Astoria but based on NHibernate as the domain model) mi sono incuriosito e ho cercato di capire cosa fossero REST e Astoria.

Per Astoria basta la seguente:
The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within corporate networks and across the internet. The data service is reachable over regular HTTP requests, and standard HTTP verbs such as GET, POST, PUT and DELETE are used to perform operations against the service. The payload format for the data exchanged with the service can be controlled by the client and all options are simple, open formats such as plan XML and JSON. The use of web-friendly technologies make it ideal as a data back-end for AJAX-style applications, Rich Interactive Applications and other applications that need to operate against data that is across the web.

Non ne sapevo nulla, ma è disponibile con Visual Studio 2008.

Il termine che mi ha incusiosito maggiormente è stato "REST-Style".
Sono andato su Wikipedia e ho attinto informazioni da altre fonti:
REST è l'acronimo di Representational State Transfer, ma la definizione che maggiormente mi ha illuminato è stata "REST - An Architectural Style, Not a Standard".

Il fatto che i documenti di cui sopra fossero un po' datati e la frase di xml.com
If you follow web services, then you may have heard of REST. REST is an architectural style that can be used to guide the construction of web services. Recently, there have been attempts to create such services that have met with mixed success.
mi ha dato da pensare: dove sono stato in tutti questi anni? Possibile che non conoscessi REST? Poi sono arrivato alla conclusione che non ne conoscevo il nome! :D

Riporto la definizione di Wikipedia per comodità:
Developer and author Paul Prescod defines a REST Web service as "a Web service that delivers its functionality entirely as a set of URI-addressable resources using the syntax and semantics of the HTTP protocol" (see Resources). You can see an example of the REST style as ubiquitously as the World Wide Web itself. The HTTP protocol underlying the Web uses Uniform Resource Locators (URLs) to denote resources and a few well-known HTTP methods, such as GET, POST, PUT, HEAD, and DELETE to manipulate the resources. This simple architectural style allows scalability and interactivity by reusing the Web's loosely coupled and distributed infrastructure.

Ho trovato anche un articolo (Considerazioni sugli aggiornamenti di WCF introdotti nel .NET Framework 3.5) di Alessio Leoncini su AspItalia, e all'inizio mi sono trovato d'accordo con le sue considerazioni e sul fatto che il supporto del REST nel WCF, possa venire interpretato come un passo indietro rispetto a SOA.

Ripensandoci bene, forse non è proprio così. Dare un supporto con un tool di sviluppo anche a chi non è pronto per SOA o non può usare Remoting o semplicemente gli sta stretta (o larga, a seconda dei punti di vista) una qualsiasi complessità di comunicazione più o meno standard, con delle regole, potrebbe non essere presa come un passo indietro. Sembra una tecnologia passata, ma quale tecnologia lo è completamente?

Un ulteriore documento a supporto (in cui vengono fatte anche delle affermazioni sul perché le grandi aziende supportino SOA piuttosto che REST) è disponibile qui (ne estrapolo un'altra definizione)
Il termine REST viene usato in senso lato per descrivere ogni interfaccia semplice che usi XML sopra l'HTTP. Un WS che abbraccia i principi REST è detto RESTful, mentre un WS che implementi una interfaccia in XML con metodi HTTP senza seguire i principi dell'architettura è detto RESTlike o semplicemente REST.

In un altro punto del testo afferma che per SOA lo sviluppatore DEVE utilizzare un tool, mentre per REST, ciò non è obbigatorio...

A questo punto traggo le mie conclusioni e riprendo il titolo del post. Ai tempi in cui programmavo in vbscript e non sapevo neanche cosa fossero il SOAP Toolkit e i web service, mi realizzavo le mie paginette .asp che, data una querystring o altre info passate mediante POST, restituivano un XML o informazioni in altro formato (a volte anche solo una stringa).
Allora nell'idea di REST non c'è molto di nuovo: si usa il protocollo HTTP per lo scambio dati, senza i contratti tipici di una architettura SOA. Come se avessi dei web service che erogano servizi mediante chiamate GET e POST.
Non c'è nulla di nuovo, ed infatti il termine esiste dal 2000... ergo: l'ho sempre usato, ma non ne conoscevo il nome!

[Update] Interessante post su REST/WCF.

Technorati :