• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Spring Boot Book

Ranch Hand
Posts: 462
Scala jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm just wondering in what circumstances you would use Spring boot? From my (limited) understanding it allows you to set up a Spring project quicker than doing it by hand but as there are other tools that already do this (maven archetypes come to mind), what advantages is there to using Spring Boot instead? Can it do other funky stuff?
Posts: 422
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I mentioned in another post, most people who have used Spring Boot will agree that you should use it in all Spring apps and certainly for new projects. The centerpiece of Spring Boot is auto-configuration which, at runtime and without code generation, determines what components should be enabled to support the type of application you're developing. It makes these decisions based on many factors (classpath, property/env-var values, etc), but in no way is any code generated.

One analogy I've seen used before is that Spring provides the eggs, sugar, flour, etc..., but Spring Boot is the cake.

Contrast this with a Maven archetype. Archetypes are essentially skeleton/baseline projects. They're just a template for you to fill in. They may or may not have some pre-existing Spring configuration in them, but even if they do, that configuration is now something you must maintain. In contrast, Spring Boot doesn't provide any code or configuration you must maintain. There is a tool at start.spring.io that produces a baseline project, including a Maven or Gradle build with pre-populated dependencies...so in some ways that is like a Maven archetype. But Spring Boot itself does not generate or provide code templates that you must maintain. This means that the bulk of the code in a Spring Boot project is very specific to that project and isn't code that is there to satisfy the framework.

Contrast Spring Boot with Spring Roo: Spring Roo generates code and provides some default configuration based on AspectJ introductions. While I was once a big fan of Spring Roo, I must admit its biggest problems are (1) code generation that must be maintained and (2) those aspects which must be kept "hands-off" to the developer. Not that I don't like AspectJ (I really do), but the idea of Roo generating code that I must check into source control, but am not allowed to touch is a bit uncomfortable. Again, Spring Boot does all of its magic without any code generation.

It bears repeating: Spring Boot is appropriate for any Spring application. It is how Spring apps are developed today. I can't imagine starting a new Spring project and not using Spring Boot any more than I can imagine building a house with nothing other than a handsaw and a hammer.
    Bookmark Topic Watch Topic
  • New Topic