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

Simplify State management in Spring Boot with H...

Simplify State management in Spring Boot with HATEOAS and KFSM

This deck accompanied a presentation from I Code Java 2020.
We cover the definition of a Finite State Machine using KFSM and implementing a Service and Controller to expose it via Rest Controller using HATEOAS and HAL.
We show how an Angular application can easily consume the API.

Corneil du Plessis

September 01, 2020
Tweet

More Decks by Corneil du Plessis

Other Decks in Programming

Transcript

  1. Simplify State management in Spring Boot with HATEOAS and KFSM

    Corneil du Plessis Chief Architect, JumpCO
  2. Quotable quotes K.I.S.S. – Keep it simple stupid! Graeme Mitchell

    “Everything should be a simple as possible, but no simpler” Albert Einstein
  3. Introduction Simplify State management in Spring Boot with HATEOAS and

    KFSM • Demo • Design • KFSM Definition • Context • Service • HATEOAS • Controller • UI – Service • UI - Components
  4. Simple Turnstile State Chart from KFSM Start Event[Guard] Target Action

    LOCKED COIN UNLOCKED { unlock() } UNLOCKED PASS LOCKED { lock() } UNLOCKED COIN UNLOCKED { returnCoin() }
  5. HATEOAS • Hypermedia as the Engine of Application State ◦

    Entities ◦ Links ◦ Collections ◦ Pages
  6. Finally • Finite State Machine • Encapsulated as a Service

    • Controller renders HATEOAS models • Front-end can easily consume HATEOAS via named templated links
  7. Resources • Twitter - @corneil • Slides - https://speakerdeck.com/corneil/simplify-state-management-in-spring-boot-with-hateoas-and-kfsm •

    KFSM Source - https://github.com/open-jumpco/kfsm • Rest Server - https://github.com/open-jumpco/kfsm-spring-rest • HATEOAS Client – https://github.com/open-jumpco/kfsm-hateoas-client Please complete the feedback form.