Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hypermedia-Driven RESTful APIs

Hypermedia-Driven RESTful APIs

Christoph Strobl

May 25, 2016
Tweet

More Decks by Christoph Strobl

Other Decks in Programming

Transcript

  1. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > Hypermedia-Driven RESTful APIs > Christoph Strobl | @stroblchristoph > Pivotal Software, Inc.
  2. 2

  3. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > > REST?
  4. 4 POST = Create, GET = Read,… Client-Server, Stateless, Cacheable

    > Representational State Transfer > uses: HTTP for CRUD > requires: Architecture Constraints Uniform Interface
  5. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > > Hypermedia?
  6. HATEOAS 8 Media Types describe resources. Actions are executed by

    following links. Response reflects state. Clients explore the API. Hypermedia as the Engine of Application State
  7. ALPS 10 Closes the gap between! ! state and transition.

    Descriptors semantic data safe GET unsafe POST idempotent PUT/DELTE Application Level Profile
 Semantics
  8. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > > Demo?
  9. Spring Data REST 13 @SpringBootApplication public class StoreApp { !

    public static void main(String[] args) { SpringApplication.run(StoreApp.class, args); } ! interface StoreRepository extends PagingAndSortingRepository<Store, String> { ! ! } } Page<Store> findByAddressLocationNear(Point location, Distance distance, Pageable pageable); @RestResource(rel = "by-location") <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId>
  10. I am completely operational.! ! All my circuits ! are

    functioning perfectly. Thank you! image source: HAL 9000 - Space Odyssey wallpaper
 http://www.wallconvert.com/