Spring Flashcards
What is Spring Framework?
Spring is a lightweight, open-source framework for building Java applications. Which provides several features that help us to build these Java apps.
What is Dependency Injection (DI) in Spring?
DI is a design pattern used by Spring to manage object dependencies. We do not care about the creation of the dependencies objects, because Spring injects them automatically.
What are the 3 ways of auto wiring in Spring and which is the default one?
We can @autowire dependencies in Spring through: field injection, setters, and constructors(this is the default one), we don’t even need to put the @autowired annotation for the default one.
What are the beans scopes and which one is the default one?
Spring beans have 5 scopes: session, application, request, prototype, and the default one (singleton)
What is the difference between Spring and Spring Boot?
Spring Boot is an extension of Spring and it simplifies application development by providing: auto-configuration, embedded servers, etc.
What is Spring AOP?
Aspect-Oriented programming allows adding cross-cutting concerns (e.g.: logging), without modifying existing code.
Key concepts: aspect, advice (what should be done), pointcut(where it should be done).
What is Spring actuator?
@RestController x @Controller
Used for REST APIs x Used for handling web pages.
What are Spring profiles and how to use it?
Spring profiles allows us to define different configurations for different environments. I can create beans for some profiles, as I want.
What is Spring Boot Actuator?
It provides built-in endpoints for monitoring applications.