• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Spring Boot Book

 
Ranch Hand
Posts: 458
Scala jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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?
 
author
Posts: 396
8
  • Mark post as helpful
  • send pies
  • 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.
 
You can't expect to wield supreme executive power just because
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic