Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is meant by Spring boot follows “Opinionated Defaults Configuration” Approach?

I have just started learning spring boot . In its official page I found out this term and I did not understand that what actually it meant in Spring boot context.

like image 895
Disha Jain Avatar asked Oct 30 '17 14:10

Disha Jain


People also ask

What is opinionated defaults configuration approach in spring boot mean?

Spring-Boot's Opinionated Defaults Configuration is more of a strategy to eliminate boilerplate and configurations meant to improve unit testing, development, and integration test procedures. It decides the defaults to use for configuration and the packages to install based on the dependencies requirement.

What is meant by opinionated view in spring boot?

Answered by Anil Saini. Opinionated is a software design pattern that decides or guides you into their way of doing things. Spring Boot is opinionated because it follows the opinionated default configuration that reduces developer efforts to configure the application.

What are the configurations in spring boot?

Spring Boot lets you externalize your configuration so that you can work with the same application code in different environments. You can use properties files, YAML files, environment variables, and command-line arguments to externalize configuration.

Does spring boot Favour configuration over convention?

Spring Boot enables developers to focus on the application logic rather than being bogged down by the intricacies of configuration. Spring has always prioritised convention over configuration as a model for simpler programming and Spring Boot Project emphasizes a similar discipline.


1 Answers

Spring Boot, is Spring on steroids if you will. It's a great way to get started very quickly with almost the entire Spring stack. I'll try to summarize as what "Opinionated Defaults Configuration" would mean in practice from a programmer's perspective below:

  1. Helps you to setup a fully working application(web app or otherwise) very quickly by providing you intelligent default configurations that you are most likely to be satisfied to start with.

  2. It does so by something called "AutoConfiguration", where capabilities from the Spring ecosystem of products are "auto-magically" enabled in your application by adding certain dependencies to your classpath; adding such dependencies via maven or gradle is super easy.

  3. Most auto-configuration respects your own configuration, and backs off silently if you have provided your own configuration via your own beans.

  4. You would benefit most if you take the java config approach of configuring your Spring application.

  5. Super silky integration of new capabilities in your application by developing your own auto-configuration components (via annotations!).

  6. Tons of auto-configaration components available ranging from Databases(h2, derby etc.), servlet containers(tomact, jetty etc.) to email and websockets are available. It is easy to develop your own. The important thing is that others can use those technology enablements in their own components. Please feel free to contribute.

  7. Helps write very clean code with all the heavy lifting taken care of you, so that you can focus more on your business logic.

Hope you have fun with Spring Boot; its absolutely among the very best of frameworks to have hit the market in the last decade or so.

like image 175
Arun Patra Avatar answered Oct 25 '22 01:10

Arun Patra