Spring & Spring Boot Annotations Series - #2 - @Autowired Annotation

Spring & Spring Boot Annotations Series - #2 - @Autowired Annotation

Java Guides

1 год назад

36,963 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@stuti5700
@stuti5700 - 03.12.2023 21:57

@Java Guides How to do autowiring based on condition. Let say here in below code if there is one variable choice if choice =1 then I want Samsung class injected if choice =2 then Redmi if choice =3 then Apple.

. class AppService
{
@Autowire
Mobile mobile;
}

class Samsung implements Mobile{

getProperties()
{
println("Memory: 500GB", "RAM :32GB", "color": Golden)
}
}

class Redmi implements Mobile{

getProperties()
{
println("Memory: 250GB", "RAM" :32GB", "color": Orange)
}
}

class Apple implements Mobile{

getProperties()
{
println("Memory: 1TB", "RAM" :32GB", "color": pink)
}
}

Ответить
@BhushanRajesh
@BhushanRajesh - 29.06.2023 11:57

Which one is recommended to use for inject beans setter injection ? constructor injection ? or field injection.

when which one is use please explain to me. so I can use based on your explaination.

Ответить
@bureddyprashanthreddy5587
@bureddyprashanthreddy5587 - 24.04.2023 10:08

Explanation is good but pls go a bit slowly
U are typing very fast and selecting options very quick which makes it a bit confusing to understand

Ответить
@goldeninky
@goldeninky - 29.03.2023 22:45

Great bro, very nicely explained

Ответить
@amanuellebassi7294
@amanuellebassi7294 - 01.03.2023 07:03

Superb as usual!

Ответить
@sreelathayadav8228
@sreelathayadav8228 - 14.02.2023 12:36

Very good explanation... Thank you

Ответить
@Vithal_Nivargi
@Vithal_Nivargi - 11.02.2023 01:40

Amazing series Sir Thank you ❤️🙏
Sir I would request you please bring one paid course from scratch spring boot+reactJS fullstack real time level application.. awaited course 🙏

Ответить
@skv8964
@skv8964 - 10.02.2023 23:12

Which one do we need to prefer ?

Do we have any specific usecase for these three ways or all this works the same ?

Thanks

Ответить
@atulrananavare1509
@atulrananavare1509 - 05.02.2023 20:21

Very informative video

Ответить
@dattatraybharde2902
@dattatraybharde2902 - 04.02.2023 19:41

Pls make video on profile annotation

Ответить