Intro to Spring Boot

13
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/ Intro to Spring Boot Eddú Meléndez Gonzales @EdduMelendez

Transcript of Intro to Spring Boot

Page 1: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Intro to Spring BootEddú Meléndez Gonzales

@EdduMelendez

Page 2: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

About Me

• Java Software Engineer

• Open Source Contributor (spring-boot, spring-session, spring-security, spring-ldap, arquillian-cube, mybatis-spring-boot-starter)

• Blogger

2

Page 3: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Developer Experience

3

Page 4: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Spring Ecosystem

4

SpringFramework

SpringSecurity

SpringData

SpringBatch

SpringIntegration

SpringAMQP

SpringHateoas

SpringMobile

SpringSocial

SpringWeb Services

Page 5: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Spring Framework

5

Page 6: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Spring Boot

6

Page 7: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

XML Config

7

<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"> <property name="username" value="sa" /> <property name="password" value="password" /> <property name="url" value="jdbc:h2:tcp://dbserver/~/test" /> <property name="driverClassName" value="org.h2.Driver" /> </bean>

Page 8: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Java Config

8

@Bean public DataSource dataSource() { org.apache.tomcat.jdbc.pool.DataSource dataSource = new org.apache.tomcat.jdbc.pool.DataSource(); dataSource.setUsername("sa"); dataSource.setPassword("password"); dataSource.setUrl("jdbc:h2:tcp://dbserver/~/test"); dataSource.setDriverClassName("org.h2.Driver"); return dataSource; }

Page 9: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Spring Boot’s configuration

9

spring.datasource.username=sa spring.datasource.password=password spring.datasource.url=jdbc:h2:tcp://dbserver/~/test #spring.datasource.driver-class-name=org.h2.Driver

Page 10: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Why Spring Boot?

• Convention over Configuration

• Provide dependency management

• Auto-configuration

• Starter dependencies

• Actuator

10

Page 11: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

DEMO

11

Page 12: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

New in Spring Boot 1.4

• Spring Framework 4.3.2

• Apache Tomcat 8.5.4

• Caffeine caching support

• More Spring Session backend supports

• Couchbase and Neo4j auto-configuration support

• Thymeleaf 2.x and 3.x compatibility

• Test improvements

12

Page 13: Intro to Spring Boot

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Learn More. Stay Connected.

Don’t miss

Testing Spring Boot Applications by Phil WebbWriting Your Own Spring Boot Starter by Dieter Hubau

@springcentral spring.io/blog

@pivotal pivotal.io/blog

@pivotalcf http://engineering.pivotal.io