Spring Boot Flashcards

1
Q

How is Spring Boot different from legacy Spring applications? What does it mean that it is “opinionated”?

A

-Spring boot is an extension of legacy Spring applications, which eliminated boilerplate configurations needed to setting up a Spring application
-Software designed pattern that decides or guides development to be constructed a certain way

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does “convention over configuration” mean?

A

Software design paradigm used by frameworks that is intended to reduce the amount of decisions a developer needs to do without losing flexibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What annotation would you use for Spring Boot apps? What does it do behind the scenes?

A

@SpringBootApplication: Equivalent of using @Configuration, @EnableAutoConfiguration, @ComponentScan with default attributes

@Configuration: allows to register extra beans in the context or import additional configuration classes

@EnableAutoConfiguration: enable Spring Boot’s auto-configure mechanism

@ComponentScan: enable @Component scan on the package where the application is loaded

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does Boot’s autoconfiguration work?

A

Attempts to automatically configure your Spring app based on the jar dependencies which you have added

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the advantage of having an embedded Tomcat server?

A

Makes it easier to distribute web apps using services like Docker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the significance of the Spring Boot starter POM?

A

Set of convenient dependency descriptors that you can include without the need of hunting specific dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the Spring Boot actuator? What information can it give you?

A

-Spring Boot actuator: a module that provides all of Spring Boot’s production-ready features

-Auditevents: Exposes audit events info for current app
-Beans: Displays complete list of all Spring beans in app
-Caches: Exposes available caches
-Conditions: Shows conditions that were evaluated on config and auto-config classes and reasons why they did or did not match
-Configprops: Displays list of all @ConfigurationProperties
-Env: Exposes properties form Spring’s
-ConfigurableEnvironment
Flyway: Shows any flyway database migrations that have been applied
-Health: Show app health info
-Httptrace: Displays http trace info
-Info: Displays arbitrary app info
-Integrationgraph: Shows Spring Integration graph
-Loggers: Shows and modifies the config of loggers in the app
-Liquibase: Shows any Liquidbase db migrations that have been applied
-Metrics: Shows ‘metrics’ info of current application
-Mappings: Displays a collated list of all @RequestMapping paths
-Scheduledtasks: Displays the scheduled task in your application
-Sessions: Allows retrieval and deletion of user sessions from a Spring Session-backed session store.
-Shutdown: Lets app gracefully shut down
-Startup: Shows the startup steps
-Threaddump: Performs a thread dump

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What files would you use to configure Spring Boot applications?

A

Application.properties/application.yaml/application.yml
Beans.xml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the benefit of using Spring Boot profiles?

A

Allows devs to place related properties and the values into an apps properties files, and allowing deployment scripts to refer to them with a single environment variable reference at runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly