Springboot Flashcards

1
Q

What are annotations used for in Springboot?

A

Annotations in Spring Boot are used to provide metadata for the Java code, enabling a simpler and more readable configuration compared to XML-based configurations. They play a crucial role in the framework, driving various functionalities and configurations.

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

What does the @Autowired annotation do?

A

It is used for dependency injection, allowing Spring to resolve and inject collaborating beans into your bean.

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

What annotations are used for dependency injection?

A

@Autowired, @Qualifier, and @Bean

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

What annotations are used for Component Scanning?

A

@Component, @Service, @Repository, and @Controller are used to automatically detect and register beans in the Spring container from the classpath scanning.

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

What annotations are used for configuration?

A

Configuration: @Configuration is used in classes that define beans. @PropertySource is used to declare a set of properties (defined in a file) in a Spring environment.

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

What annotations are used for web development?

A

Web Development: Annotations like @RequestMapping (and its variant annotations like @GetMapping, @PostMapping, etc.), @ResponseBody, @RestController, and @PathVariable are heavily used in Spring MVC for handling web requests.

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

What annotations are used for Aspect, Oriented (AOP) Programming

A

Aspect-Oriented Programming (AOP): @Aspect, @Before, @After, @Around, etc., are used for aspect-oriented programming which allows implementing cross-cutting concerns.

  1. @Aspect
  2. @Before
  3. @After
  4. @Around
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What annotations are used for transitional management?

A

Transaction Management: @Transactional is used for declarative transaction management.

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

What annotations are Springboot specific?

A

Spring Boot-Specific Features: Annotations like @SpringBootApplication, @EnableAutoConfiguration, and @SpringBootConfiguration are specific to Spring Boot and help with auto-configuration, component scanning, and configuration setup.

  1. @SpringBootApplication
  2. @EnableAutoConfiguration
  3. @SpringBootConfiguration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What annotations are used in testing?

A

Testing: @SpringBootTest, @DataJpaTest, @WebMvcTest, etc., are used to simplify the setup and configuration of tests.

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

What annotations are used in security?

A

Security: Annotations like @PreAuthorize, @PostAuthorize, @Secured, etc., are used for method-level security.

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

What invitations are used in data access?

A

Data Access: @Entity, @Table, @Id, etc., are used in Spring Data JPA for ORM (Object-Relational Mapping) and database operations.

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

What annotations are used in validation?

A

Validation: Annotations such as @Valid, @NotNull, @Size, etc., are used for validating Java beans.

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

What annotations are used in caching?

A

Caching: @EnableCaching, @Cacheable, @CacheEvict, etc., are used for caching abstractions.

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

What annotations are used in scheduled tasks?

A

Scheduled Tasks: @Scheduled is used to define methods that should run at a fixed interval or cron expression.

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

What annotations are used in event handling?

A

Event Handling: Annotations like @EventListener are used to mark methods as event listeners.