drupal as a restful backend for client side applications

16

Upload: myplanet-digital

Post on 17-Nov-2014

3.733 views

Category:

Documents


0 download

DESCRIPTION

Arivn Singla's presentation from Drupal Camp Toronto 2012

TRANSCRIPT

Page 1: Drupal As A RESTful Backend For Client Side Applications
Page 3: Drupal As A RESTful Backend For Client Side Applications

Contact us:207-90C Centurian DrMarkham, OntarioL3R 8C5

Arvin Singla@[email protected]

We’re hiring!

Page 4: Drupal As A RESTful Backend For Client Side Applications

Getourselves arRESTed

Page 5: Drupal As A RESTful Backend For Client Side Applications

REpresentational State Transfer

• Architectural Style– Many ways to implement

• 5 Primary Constraints to be considered “RESTful”– Client / Server– Stateless– Cacheable– Layered System– Uniform Interface

Page 6: Drupal As A RESTful Backend For Client Side Applications

wRESTling

with the web

Page 7: Drupal As A RESTful Backend For Client Side Applications

Why do we REST?

• Client side and Mobile Applications– Apps load fast, data comes after– Local caching

• API data access– Allow others to use your data

Page 8: Drupal As A RESTful Backend For Client Side Applications

RESTful Web API

• Web service implemented using HTTP and the principles of REST

• Clients interact with RESTful servers over HTTP methods– Create (POST)– Read (GET)– Update (PUT)– Delete (DELETE)

Page 9: Drupal As A RESTful Backend For Client Side Applications

RESTrainyourself fromthe excitement!

Page 10: Drupal As A RESTful Backend For Client Side Applications

Services Module (3.x)

– Creates URL callback endpoints for integrating external applications

– Supports multiple interfaces including REST, XMLRPC, JSON, JSON-RPC, SOAP, AMF, etc.

Page 11: Drupal As A RESTful Backend For Client Side Applications

Services Module (3.x)

– Supports Drupal core resources, third party integration is done with modules

– Authentication and OAUTH support

– Performs a full bootstrap :(

– Caching in 7.x-dev YAY! (Issue #1791978)

Page 12: Drupal As A RESTful Backend For Client Side Applications

Services Endpoints

Create: POST/[endpoint_path]/[resource] + bodyRetrieve: GET/[endpoint_path]/[resource]/[resource_id]Update: PUT/[endpoint_path]/[resource]/[resource_id] + bodyDelete: DELETE/[endpoint_path]/[resource]/[resource_id]

Page 13: Drupal As A RESTful Backend For Client Side Applications

Demo time!

Page 14: Drupal As A RESTful Backend For Client Side Applications

cRESTing towards the future

Page 15: Drupal As A RESTful Backend For Client Side Applications

Drupal 8: The Promise Land

• WSCCI: Web Services and Context Core Initiative– Utilizing Symfony 2 HTTP services– Native RESTful services baked into

Core

Page 16: Drupal As A RESTful Backend For Client Side Applications

qRESTions?