SpringOne2GX 2014: Spring Data REST - Data Meets Hypermedia
See a demo of Spring Data REST where three different front ends interact with a single back end to snap pictures and upload them to Spring-a-Gram, a $1B acquisition in the making!
What is Spring Data REST? • Implements common patterns on top of repositories • Collection / Item resources • Association resources • Search resources • Supports • JPA, GemFire, Neo4j, MongoDB • Others are coming… 6
What is Spring Data REST? • Leverages hypermedia & internet standards • HAL (draft) • ALPS (draft) • URI Templates (RFC 6570) • text/uri-list mediatype (RFC 2483) • profile link relation (RFC 6906) 8 You aren’t building a “Spring Data REST” app, but instead a RESTful standards- based app.
10 Hypertext Application Language A lean hypermedia type application/hal+json HAL Adopting HAL will make your API explorable, and its documentation easily discoverable from within the API itself. — Mike Kelly, HAL spec lead
Spring Framework vs Spring for Android • Core • RestTemplate 22 https://github.com/spring-projects/spring-android http://projects.spring.io/spring-android
HTTP Message Converters • MappingJackson2HttpMessageConverter - object to JSON marshaling supported via the Jackson JSON Processor • GsonHttpMessageConverter - object to JSON marshaling supported via Google Gson • SimpleXmlHttpMessageConverter - object to XML marshaling supported via the Simple XML Serializer 25
Getting Started Guides at http://spring.io/guides • Consuming a RESTful Web Service with Spring for Android • Consuming XML from a RESTful Web Service with Spring for Android • Building Android Projects with Gradle • Building Android Projects with Maven • Installing the Android Development Environment 31
33 github.com/spring-projects/spring-data-rest github.com/spring-projects/spring-android github.com/SpringOne2GX-2014/spring-a-gram github.com/SpringOne2GX-2014/spring-a-gram-android Want to see more? Questions?