General Knowledge Flashcards

1
Q

Spring implements various design patterns

A

*Factory
*Builder
*Proxy

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

Spring web project structure/packages

A

**domain –> should cointain entities to be persisted in the DB. EG person
**repositories–>the JPA implementation?–> interface PersonRepository and PersonRepositoryImpl –>defines and implements the operation that can be done for the entity–> getByID. etc
In reactive :Mono interface=0 or one Flux=0 or many?
**controllers –> classes that define the endpoints–>invoke the service
**model–> DTO clases (data trasfer object) used in controller to mirror the db/domanin entities. Why: because it is not recommend to expose your db entities and because we might have a different needs in the controller than in the services?. The DTOs do not need the SpringData annotations
**services–>

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

Spring does automatically a component scan for the packge and subpackes that contains the Spring Main?

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

Dependency Injection

A

Dependency injection (DI) is a process whereby objects define their dependencies (that is, the other objects with which they work) only through constructor arguments, arguments to a factory method, or properties that are set on the object instance after it is constructed or returned from a factory method. The container then injects those dependencies when it creates the bean.
DI exists in two major variants: Constructor-based dependency injection and Setter-based dependency injection.

https://docs.spring.io/spring-framework/reference/core/beans/dependencies/factory-collaborators.html

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