Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Spring Boot and Groovy.
What more do you need?
Iván López - @ilopmar
Hello!
I am Iván López
@ilopmar
http://greachconf.com@madridgug
What is
Spring Boot?
Spring Boot
▷ Fast bootstrap for Spring applications
▷ Opinionated framework (convention over
configuration)
▷ Total integ...
Why is different?
▷ Non-functional requirements
▷ No XML/Code generation
▷ Groovy!
▷ Stand-alone applications
▷ Micro-serv...
What do I need to install it?
▷ Java 6+
▷ GVM: http://gvmtool.net
▷ Download it
Spring Boot CLI
1.
Demo
Spring Boot CLI
What happened?
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.EnableAutoC...
What happened?
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.EnableAutoC...
@EnableAutoConfiguration
▷ Tries to configure automatically the app
▷ Use the .jars on our classpath
▷ It goes away when w...
Starters
▷ Standard POMs
▷ Recommended dependencies
▷ Transitive dependencies management
Starters
actuator
amqp
aop
batch
data-elasticsearch
data-mongodb
groovy-templates
integration
jdbc
redis
remote-shell
secu...
Alright. How do I start?
▷ http://start.spring.io
▷ Maven/Gradle
▷ Java/Groovy
▷ JDK version (6, 7 & 8)
▷ Starters
Project structure
$ tree
.
├── build.gradle
└── src
├── main
│   ├── groovy
│   │   └── eu
│   │   └── gr8conf
│   │   └──...
spring-boot-starter-actuator
▷ Non-functional requirements
▷ Metrics
▷ Health-checks
Ready for production
▷ Spring boot CLI
spring jar my-app.jar app.groovy
java -jar my-app.jar
▷ Gradle
./gradlew build
java...
“Make jar not war
- Josh Long
(@starbuxman)
Configuration
▷ application.properties / application.yml
▷ Override properties
java -jar app.jar --server.port=8181
▷ @Con...
Logging
▷ Logback by default
▷ Groovy configuration: logback.groovy
▷ @groovy.util.logging.Slf4j
2.
Demo
What about Grails?
▷ Grails 3 built on top of Spring Boot
▷ Hybrid projects
And the bad things?
▷ It's Spring (for good and for bad)
▷ Annotation Driven Development
▷ Documentation
3.
Summary
Let’s review some concepts
Fast bootstrap
Spring applications
Future of Spring
Framework
Micro-services
Gaining a lot of
t...
Thanks!
Any questions?
@ilopmar
lopez.ivan@gmail.com
https://github.com/lmivan
Iván López
http://kcy.me/23j7w
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
Prochain SlideShare
Chargement dans…5
×

GR8Conf 2015 - Spring Boot and Groovy. What more do you need?

2 798 vues

Publié le

Spring Boot allows the creation of Spring Framework based applications in a quick and easy way without any XML configuration. It does not generate code, but provides useful defaults and an opinionated approach to the configuration but it quickly gets out of the way when we want to change and override the configuration. As if this wasn't enough we can also create production-ready applications with features such as metrics, health checks and externalized configuration.

If you add Groovy you have the perfect combination to speed up your development and have fun while developing.

In this talk you will see introductory examples of Spring Boot, the creation of a small RESTful API, the usage of Websockets, some of the Spring Boot CLI goodness... and many more examples!

Publié dans : Technologie
  • Soyez le premier à commenter

GR8Conf 2015 - Spring Boot and Groovy. What more do you need?

  1. 1. Spring Boot and Groovy. What more do you need? Iván López - @ilopmar
  2. 2. Hello! I am Iván López @ilopmar http://greachconf.com@madridgug
  3. 3. What is Spring Boot?
  4. 4. Spring Boot ▷ Fast bootstrap for Spring applications ▷ Opinionated framework (convention over configuration) ▷ Total integration with Spring ecosystem
  5. 5. Why is different? ▷ Non-functional requirements ▷ No XML/Code generation ▷ Groovy! ▷ Stand-alone applications ▷ Micro-services
  6. 6. What do I need to install it? ▷ Java 6+ ▷ GVM: http://gvmtool.net ▷ Download it
  7. 7. Spring Boot CLI
  8. 8. 1. Demo Spring Boot CLI
  9. 9. What happened? import org.springframework.boot.SpringApplication import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController   @Grab('org.springframework.boot:spring-boot-starter-web:1.2.3.RELEASE') @EnableAutoConfiguration @RestController class ThisWillActuallyRun {   @RequestMapping("/") String home() { 'Hello GR8Conf!' }   static void main(String[] args) { SpringApplication.run ThisWillActuallyRun, args } }
  10. 10. What happened? import org.springframework.boot.SpringApplication import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController   @Grab('org.springframework.boot:spring-boot-starter-web') @EnableAutoConfiguration @RestController class ThisWillActuallyRun {   @RequestMapping("/") String home() { 'Hello GR8Conf!' }   static void main(String[] args) { SpringApplication.run ThisWillActuallyRun, args } }
  11. 11. @EnableAutoConfiguration ▷ Tries to configure automatically the app ▷ Use the .jars on our classpath ▷ It goes away when we define our beans
  12. 12. Starters ▷ Standard POMs ▷ Recommended dependencies ▷ Transitive dependencies management
  13. 13. Starters actuator amqp aop batch data-elasticsearch data-mongodb groovy-templates integration jdbc redis remote-shell security websockets ...
  14. 14. Alright. How do I start? ▷ http://start.spring.io ▷ Maven/Gradle ▷ Java/Groovy ▷ JDK version (6, 7 & 8) ▷ Starters
  15. 15. Project structure $ tree . ├── build.gradle └── src ├── main │   ├── groovy │   │   └── eu │   │   └── gr8conf │   │   └── DemoApplication.groovy │   └── resources │   ├── application.properties │   ├── static │   └── templates └── test └── groovy └── eu └── gr8conf └── DemoApplicationTests.groovy
  16. 16. spring-boot-starter-actuator ▷ Non-functional requirements ▷ Metrics ▷ Health-checks
  17. 17. Ready for production ▷ Spring boot CLI spring jar my-app.jar app.groovy java -jar my-app.jar ▷ Gradle ./gradlew build java -jar build/libs/my-app-0.0.1.jar
  18. 18. “Make jar not war - Josh Long (@starbuxman)
  19. 19. Configuration ▷ application.properties / application.yml ▷ Override properties java -jar app.jar --server.port=8181 ▷ @ConfigurationProperties
  20. 20. Logging ▷ Logback by default ▷ Groovy configuration: logback.groovy ▷ @groovy.util.logging.Slf4j
  21. 21. 2. Demo
  22. 22. What about Grails? ▷ Grails 3 built on top of Spring Boot ▷ Hybrid projects
  23. 23. And the bad things? ▷ It's Spring (for good and for bad) ▷ Annotation Driven Development ▷ Documentation
  24. 24. 3. Summary
  25. 25. Let’s review some concepts Fast bootstrap Spring applications Future of Spring Framework Micro-services Gaining a lot of traction Gradle integration Groovy
  26. 26. Thanks! Any questions? @ilopmar lopez.ivan@gmail.com https://github.com/lmivan Iván López http://kcy.me/23j7w

×