FlashKeepers

Java · College · College and University

Spring Boot Fundamentals

Spring Boot auto-configuration, dependency injection, beans, annotations, REST controllers, Spring Data JPA, profiles and Actuator.

About this set

40 basic cards for College Java. It opens with "What does Spring Boot auto-configuration do?" and "Which annotation enables Spring Boot auto-configuration?". Study it alongside the other College sets below.

40 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What does Spring Boot auto-configuration do?
Show answerAutomatically configures the Spring application based on jar dependencies found on the classpath.
Which annotation enables Spring Boot auto-configuration?
Show answer@EnableAutoConfiguration or @SpringBootApplication
How do you exclude a specific auto-configuration class in Spring Boot?
Show answerUse the exclude or excludeName attribute in @SpringBootApplication or @EnableAutoConfiguration.
What does the spring-boot-autoconfigure JAR contain?
Show answerPre-written auto-configuration classes for common frameworks and libraries.
Can you use both @SpringBootApplication and @EnableAutoConfiguration on the same class?
Show answerNo, @SpringBootApplication already includes @EnableAutoConfiguration.
What is dependency injection in Spring?
Show answerThe process of providing objects with their dependencies rather than having objects create their own dependencies.
Name the three types of dependency injection in Spring.
Show answerConstructor injection, setter injection, and field injection.
Which dependency injection method is recommended for required dependencies?
Show answerConstructor injection.
What does the @Autowired annotation do?
Show answerMarks a field, setter method, or constructor as a place where Spring should inject a dependency.
What is a Spring Bean?
Show answerAn object that is instantiated, assembled, and managed by the Spring container.
How do you define a Spring Bean using annotations?
Show answerUse @Bean on a method inside a @Configuration class, or use @Component, @Service, @Repository, or @Controller on a class.
What is the default scope of a Spring Bean?
Show answerSingleton (one instance per Spring container).
Name three Spring Bean scopes.
Show answerSingleton, prototype, request, session, and application.
What annotation marks a class as a component to be detected and registered as a bean?
Show answer@Component
What is the difference between @Service and @Repository?
Show answerBoth are specialized @Component stereotypes; @Service is for business logic classes and @Repository is for data access classes.

25 more cards in the app

Study this set free