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

JVM Web Frameworks Exploration

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
Avatar for Kevin Tan Kevin Tan
December 19, 2015

JVM Web Frameworks Exploration

JVM Web Frameworks Exploration covering Grails, Spring Boot and Ratpack.

Avatar for Kevin Tan

Kevin Tan

December 19, 2015

More Decks by Kevin Tan

Other Decks in Technology

Transcript

  1. Common Patterns in Web Frameworks 1. Able to go micro

    (microservices) or full blown 2. Layout templating (simplicity of front end coding) 3. Able to initialize and bootstrap data in development mode 4. Code generation to hasten the development process and reduce the margin of error 5. Non-cryptic error messages 6. Supports auto-reloading to some extent 7. Ease of deployment 8. RESTful (architectural style)
  2. Grails 3 Domain as REST Resource Multi database support in

    GORM - Postgresql, MySql, MongoDB, etc Profiles (as of Grails 3.x) - web-api, web-micro, etc Plugin ecosystem - optional components such as Spring Security Core Spock testing framework integrated GSP Layout Templating
  3. Spring Boot Production ready features - metrics, health checks, app

    configs, etc. Can be coded in Java or Groovy, depends on your liking full blown / micro web deploys as WAR, JAR or even Groovy script Any layout templating language you choose such as Thymeleaf, GSP or Groovy template engine
  4. Spring Boot Demo Start project using http://start.spring.io For more concrete

    examples: https://github.com/spring-projects/spring-boot/tree/master/spring-boot- samples
  5. Spring Boot Demo Use the command line: spring init --list

    (to list down the spring components you can initialize with a new project) then: spring init --java=1.8 --dependencies=websocket,data-jpa --packaging=war <ProjectName> https://docs.spring.io/spring-boot/docs/current/reference/html/cli-using-the-cli. html
  6. Ratpack Flexible Metrics integration Circuit breaker for fault tolerance Dependency

    injection In-built modules such as sessions, auth, etc Groovy template engine as default layout templating
  7. Ratpack Demo lazybones create ratpack <project name> For more concrete

    examples: https://github.com/ratpack/example-books
  8. BEST of ALL THREE Deployable by just using ONE groovy

    script Grape Dependency Engine in Groovy (with @Grapes and @Grab ) Netty server / Embedded Tomcat container
  9. Groovy Script Example : Spring Boot @RestController class TestSpringMicro {

    @RequestMapping("/") String home() { "Hello World!" } }
  10. Groovy Script Example : Ratpack groovy ratpack.groovy for this script

    written below (You can tweet this!) : @Grab(‘io.ratpack:ratpack-groovy:1.0.0’) import static ratpack.groovy.Groovy.ratpack ratpack { handlers{ render “Hello world!” } }
  11. Groovy script based Microservices? When to use it?? Prototyping Hackathons

    Production use (code and deploy while production is running) #not100percentsure #perhapsnotsopractical #whoknows
  12. References Spring Boot - http://projects.spring.io/spring-boot/ Grails - http://www.grails.org/ Ratpack -

    https://ratpack.io/ Groovy programming language - http://www.groovy-lang.org/