Spring Flashcards

1
Q

What is Spring Framework?

A

Spring is a lightweight, open-source framework for building Java applications. Which provides several features that help us to build these Java apps.

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

What is Dependency Injection (DI) in Spring?

A

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.

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

What are the 3 ways of auto wiring in Spring and which is the default one?

A

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.

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

What are the beans scopes and which one is the default one?

A

Spring beans have 5 scopes: session, application, request, prototype, and the default one (singleton)

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

What is the difference between Spring and Spring Boot?

A

Spring Boot is an extension of Spring and it simplifies application development by providing: auto-configuration, embedded servers, etc.

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

What is Spring AOP?

A

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).

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

What is Spring actuator?

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

@RestController x @Controller

A

Used for REST APIs x Used for handling web pages.

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

What are Spring profiles and how to use it?

A

Spring profiles allows us to define different configurations for different environments. I can create beans for some profiles, as I want.

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

What is Spring Boot Actuator?

A

It provides built-in endpoints for monitoring applications.

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