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

Intro to Spring Boot

Avatar for Brian Clozel Brian Clozel
September 23, 2014

Intro to Spring Boot

Short introduction to Spring Boot http://projects.spring.io/spring-boot
Talk presented in JUGs

Avatar for Brian Clozel

Brian Clozel

September 23, 2014
Tweet

More Decks by Brian Clozel

Other Decks in Programming

Transcript

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

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Brian Clozel, Spring Framework committer, Pivotal Software inc. @brianclozel Intro to Spring Boot Et merci à Stéphane Nicoll (@snicoll) pour ses slides!
  2. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Show of hands! 2
  3. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 3
  4. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ New spring.io website 4
  5. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 5 @brianclozel Brian Clozel spring.io/team/bclozel
  6. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ We <3 Spring because § Great programming model § 10+ years of open source § Strong commitment to enterprise apps § Spring portfolio § Always thinking ahead 6
  7. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What’s Spring Boot? 7
  8. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 8 “Spring Boot lets you pair-program with the Spring team. Josh Long, @starbuxman
  9. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ ಠ_ಠ Spring Boot is NOT § A prototyping tool § Only for embedded container apps § Sub-par Spring experience § For Spring beginners only 9
  10. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Boot - Spring portfolio 10
  11. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Boot § Single point of focus § Get you started very quickly with Spring § Common non-functional requirements for a "real" application § Exposes a lot of useful features by default § Gets out of the way quickly if you want to change defaults § An opportunity for Spring to be opinionated 11
  12. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring 4 - @Conditional 12 @Conditional(CustomCondition.class) @Configuration public class AppConfiguration { }
  13. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Boot - @EnableAutoConfiguration 13 @Configuration @EnableAutoConfiguration class HomeController { public static void main(String[] args) { SpringApplication.run(MyApplication.class, args); } }
  14. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Boot - AutoConfiguration examples 14 @Configuration @ConditionalOnClass(ObjectMapper.class) class JacksonObjectMapperAutoConfiguration { } @Configuration @ConditionalOnMissingBean(name = "groovyTemplateViewResolver") public GroovyTemplateViewResolver groovyTemplateViewResolver { }
  15. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Boot Starters § Standard Maven POMs, build.gradle files § Takes care of recommended dependencies 15 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> compile("org.springframework.boot:spring-boot- starter-web")
  16. Demo Unless otherwise indicated, these slides are 
 © 2013-2014

    Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SPRING BOOT
  17. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Quickstart with start.spring.io 17
  18. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Boot - Actuator endpoints 18 § autoconfig, beans, mappings § dump, trace, env § health, metrics, info
  19. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ http://spring.io - Boot is ready for prime time! 19 http://github.com/spring-io/sagan
  20. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ JDK8 + Spring Framework 4 + Spring Boot 20 Your next application?
  21. Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,

    Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Questions ? 21