What is left to configure with Spring boot?

1

The settings I usually use with spring are based on the Java class, as in this example link .

If this project used spring boot , what settings would still be required to configure in classes?

I looked at an example in which to set up an interceptor with spring boot , they created a class to configure, so there is a limit to spring boot , as far as possible configure with application.properties ?

    
asked by anonymous 08.02.2016 / 01:55

1 answer

6

Configuring with Spring Boot

  

If this project used the spring boot, what settings would still be required to configure in the classes?

Actually, you could remove some of the settings, because the idea of Spring Boot is to merge the most used components of Spring using some conventions and prevent you from having to do this manually.

So much so that Spring Boot actually has "flavors" ready for the most common types of application. View list here .

In a simple web design example , you can see that the only required configuration was:

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Application.properties

  

I looked at an example in which to set up an interceptor with spring boot, they created a class to configure, so there is a limit to the spring boot, so far as it can be configured with application.properties?

application.properties is not a replacement for application configuration. It is just a facilitator for the most common configuration variations. This helps a lot in most cases, but in a non-trivial application it's almost inevitable that you do not have to use settings via annotations or even via XML, depending on your purpose.

See the list of most common settings here .

The recommended way to setup is by using annotations. For example, to declare a new bean , simply declare a method in any configuration class whose return is the instance and note the method with @Bean .

There's nothing wrong with undesirable side effects in doing this kind of setup, so do not spend time trying to get away from it, unless it's to use some standard feature easily enabled by application.properties .

Examples and migration

I have several examples of projects using Spring Boot on my Github .

I think the easiest way for you to use SpringBoot in your project is to first change the configuration ( pom.xml ) according to the examples, then the application configuration (annotations and methods of configuration classes).

You probably will not need any changes to the system itself, except maybe moving some place to fit the Spring Boot pattern. So it's just a matter of transposing the way you set up and over time you'll find out what Spring Boot offers most easily.

However, Spring Boot is not much more than Spring with conventions, so a good application may not have gained any migrations.

    
08.02.2016 / 02:57