Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: Inversion of Control (IoC)

Front

How can you handle transaction self-invocation issues?

Use self-invocation through a separate bean or AOP proxy. To handle transaction self-invocation, ensure that the transactional method…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

Why does the @Configuration annotation matter in practice?

The @Configuration annotation indicates that a class declares one or more @Bean methods. The @Configuration annotation is used…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

What does the @Component annotation do?

The @Component annotation marks a class as a Spring-managed bean. The @Component annotation is used to indicate that…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

How does Spring manage prototype bean scopes?

Spring creates a new instance of a prototype-scoped bean every time it's requested. Prototype bean scope means that…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

What benefits does Spring Boot auto-configuration offer?

Spring Boot auto-configuration reduces boilerplate setup by automatically configuring beans based on the classpath. Auto-configuration in Spring Boot…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

How would you explain the issue with transaction self-invocation in Spring in an interview?

Transaction self-invocation prevents transactional behavior from being applied. Transaction self-invocation occurs when a method calls another method within…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

Why is constructor injection preferred over setter injection?

Constructor injection is preferred because it ensures immutability and makes dependencies explicit. Constructor injection is favored because it…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

How does the Application Context manage bean lifecycles?

The Application Context takes over instantiation, configuration, and lifecycle management of beans. In a Spring application, the Application…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

What role does the @Configuration annotation play in Spring Boot?

The @Configuration annotation indicates that a class declares one or more @Bean methods. In Spring Boot, the @Configuration…

View Card →
Flashcard Study

Java: Inversion of Control (IoC)

Front

How does the Spring container handle bean destruction?

The Spring container manages bean destruction by invoking lifecycle methods like @PreDestroy. When a Spring container is closed,…

View Card →