workshop guide: restful java web application with spring boot

16
Java Development RESTful API with SPRING BOOT

Upload: fabricio-epaminondas

Post on 15-Jul-2015

1.072 views

Category:

Software


4 download

TRANSCRIPT

Page 1: Workshop Guide: RESTful Java Web Application with Spring Boot

Java Development

RESTful API with SPRING BOOT

Page 2: Workshop Guide: RESTful Java Web Application with Spring Boot

01 Spring Boot

Goals

Page 3: Workshop Guide: RESTful Java Web Application with Spring Boot

Fast quick start experience

• Provide a radically faster and widely accessible getting started experience for all Spring development.

Reference: [1] http://docs.spring.io/spring-boot/docs/1.2.2.BUILD-SNAPSHOT/reference/htmlsingle/#boot-documentation

01

Page 4: Workshop Guide: RESTful Java Web Application with Spring Boot

Convention Over Configuration

• Be opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults.

Reference: [1] http://docs.spring.io/spring-boot/docs/1.2.2.BUILD-SNAPSHOT/reference/htmlsingle/#boot-documentation

01

Page 5: Workshop Guide: RESTful Java Web Application with Spring Boot

Non-functional features

• Provide a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration).

Reference: [1] http://docs.spring.io/spring-boot/docs/1.2.2.BUILD-SNAPSHOT/reference/htmlsingle/#boot-documentation

01

Page 6: Workshop Guide: RESTful Java Web Application with Spring Boot

No required XML configuration

• Absolutely no code generation and no requirement for XML configuration.

Reference: [1] http://docs.spring.io/spring-boot/docs/1.2.2.BUILD-SNAPSHOT/reference/htmlsingle/#boot-documentation

01

Page 7: Workshop Guide: RESTful Java Web Application with Spring Boot

Highlights

01 Spring Boot

Page 8: Workshop Guide: RESTful Java Web Application with Spring Boot

Stand-alone Java Apps

Reference: [1] http://projects.spring.io/spring-boot/

02

Page 9: Workshop Guide: RESTful Java Web Application with Spring Boot

Easy build tooling

Reference: [1] http://projects.spring.io/spring-boot/

• Provide opinionated 'starter' POMs to simplify your Maven and Gradle configurations

02

Page 10: Workshop Guide: RESTful Java Web Application with Spring Boot

Default Embedded Servers

Reference: [1] http://projects.spring.io/spring-boot/

• Embed Tomcat • Jetty • Undertow directly • …no need to deploy WAR files

02

Page 11: Workshop Guide: RESTful Java Web Application with Spring Boot

Production ready-features

Reference: [1] http://projects.spring.io/spring-boot/

Externalized configuration with runtime override

Metrics and Health Check

02

Page 12: Workshop Guide: RESTful Java Web Application with Spring Boot

IDE Integration vs All-in-One Distribution

Reference: [1] http://projects.spring.io/spring-boot/

02

• Eclipse IDE • Spring Tool Suite (STS) : All-in-One

Page 13: Workshop Guide: RESTful Java Web Application with Spring Boot

03 Hands-On

45min Workshop

Page 14: Workshop Guide: RESTful Java Web Application with Spring Boot

Agenda1.Setup: Java 6+ (recommended 7 or 8) 2.Create Java Web App 3.Create RESTFul Controller

1.GET 2.POST

4.Testing: IntegrationTest, WebApiTest 5.Validating input data 6.Saving Data

• Create a Transactional Service Component • Define Entity Domain Model • Create a Repository

7.Database Initialization

03

Page 15: Workshop Guide: RESTful Java Web Application with Spring Boot

See more…

• Using Hypermedia in REST APIs with Spring

HATEOAS

• Securing REST APIs

• Hexagonal Architecture for Java Applications

! fabricioepa.wordpress.com

Page 16: Workshop Guide: RESTful Java Web Application with Spring Boot

Contact

FABRICIO EPAMINONDAS " linkedin.com/in/fabricioepa

! fabricioepa.wordpress.com

# @fabricioepa