Spring Framework 6.2: Core Container Revisited by Juergen Hoeller @ Spring I/O 2024

  Рет қаралды 5,902

Spring I/O

Spring I/O

Күн бұрын

Пікірлер: 7
@MORETHANOVERGROWN
@MORETHANOVERGROWN 6 ай бұрын
At around 22:15 he says an app context goes through around 15 steps to initialize itself. Where can I see a summary of the steps/a diagram? I cannot find one on the reference docs.
@ilkou
@ilkou 6 ай бұрын
I can't really think of a use case for @Fallback, it seems like @Primary can do everything.. thoughts??
@diegomx80
@diegomx80 6 ай бұрын
Normally we use @Primary to tell Spring which bean to use when there are several available, but as you know, a Spring application will not start if a bean is missing. This is where @Fallback can be useful, meaning that if no bean is provided then use the @Fallback one, and if one is provided there is no need to mark it as @Primary as I understand it.
@ilkou
@ilkou 6 ай бұрын
@@diegomx80 I understand how it works, but u can achieve the same thing using @Primary, no?
@ilkou
@ilkou 6 ай бұрын
@@diegomx80 if u define a primary (1) and a none primary bean (2) then (2) is the fallback of (1), no?
@hariseldon02
@hariseldon02 6 ай бұрын
Spring Boot will step back from autoconfiguring beans if it finds an autowire candidate in the context (@ConditionalOnMissingBean). @Fallback ensures your standard still works, while you can have additional beans that you only need for a special case.
@silberwolfSR71
@silberwolfSR71 6 ай бұрын
I imagine this could be useful in more complex configuration scenarios. Say you have a configuration C that you share between multiple modules. It provides (among other things) a bean Z implementing some interface. In module A you want to use the module's own bean X in favor of Z. So you need to leave Z un-annotated and annotate X with @Primary. In module B you want to use Z in favor of the module's own bean Y, but Z is not annotated with @Primary. Now you can annotate the "local" bean Y with @Fallback, so if the shared configuration C is present, it will prefer bean Z.
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
How to have fun with a child 🤣 Food wrap frame! #shorts
0:21
BadaBOOM!
Рет қаралды 17 МЛН
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Google I/O 2012 - Go Concurrency Patterns
51:27
Google for Developers
Рет қаралды 822 М.
Bootiful Spring Boot 3.x by Josh Long @ Spring I/O 2024
54:26
Spring I/O
Рет қаралды 33 М.
Bootiful Spring Boot 3 x by Josh Long
44:32
Devoxx
Рет қаралды 30 М.
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН