15
Spring Boot(camp) Getting started for the real world

Spring boot - Getting Started

Embed Size (px)

Citation preview

Page 1: Spring boot - Getting Started

Spring Boot(camp)Getting started for the real world

Page 2: Spring boot - Getting Started

<[email protected]>

Spring-Boot in a Nutshell

Page 4: Spring boot - Getting Started

<[email protected]>

Demo - Main Concepts

Repository

Entity

Controller

Application

The thing that exposes

Resources

The thing that handles Database

access

The Resource

The beginning of everything

Page 5: Spring boot - Getting Started

<[email protected]>

Demo - Hello World REST

Application

Page 6: Spring boot - Getting Started

<[email protected]>

Demo - Hello World REST

EntityDatabase

Page 7: Spring boot - Getting Started

<[email protected]>

Demo - Hello World REST

Repository

Entity

Controller

Database

Page 8: Spring boot - Getting Started

<[email protected]>

Demo - Hello World REST

Controller

$ curl http://localhost:8080/helloworld/

Repository

Page 9: Spring boot - Getting Started

<[email protected]>

Demo - Hello World REST

Controller

$ curl http://localhost:8080/helloworld/ [{"id":"1","greeting":"Kosice="}, {"id":"2","greeting":"Bonn="}, {"id":"3","greeting":"Duesseldorf="}]

Page 10: Spring boot - Getting Started

<[email protected]>

Demo - Hello World REST

Controller

$ curl http://localhost:8080/helloworld/1 {"id":"1","greeting":"Kosice="}

Page 11: Spring boot - Getting Started

<[email protected]>

Demo - Hello World RESTcurl -X POST -d 'Kosice'

http://localhost:8080/helloworld/HTTP/1.1 201 Created{"greeting":"Kosice"}

Controller

Page 13: Spring boot - Getting Started

<[email protected]>

Building Boot-TodoI want to create a new

Todolist

I want to add a new Todoitem to a Todolist

TodolistPublic Id

Name

TodoitemPublic Id

Description Done?

Due Date

I want to finish a Todoitem

I want to remove Todoitems from a

Todollist

Page 14: Spring boot - Getting Started

<[email protected]>

Building Boot-Todo• Fetch Spring-Boot dependencies

• Create Todoitem and Todolist as Resources

• Create RestController and Repository for Todoitem Resource

• Create RestController and Repository for Todolist Resource

• Test it!