Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Instructor: In this video will cover Annotation
Autowiring and Qualifiers.
For auto wiring,
we're injecting a coach implementation.
So, Spring will scan for components,
check to see if anyone implements a given coach interface.
If so, let's inject them.
But if we have multiple implementations, which one,
like what algorithm will Spring use to determine
which coach that it should implement? Hmm.
So, here's a diagram here
of our multiple coach implementations.
So, we have coach, cricket coach,
baseball coach, track coach, tennis coach, et cetera.
And then, we have the actual source code
for these implementations.
So, we have our cricket coach, baseball, track and tennis.
All implement the coach interface.
So, when we ask for a coach implementation,
which one will Spring pick?
Well, we have a little problem.
So, this is the error message that you'll actually
encounter when you run your application.
Spring will say there's a parameter zero of the constructor
and the controller required a single bean,
but four were found.
Okay so, I need a coach,
but there's too many of them out here.
And at this point, Spring will not start up.
The application will not start
because there's too much ambiguity.
Spring can't figure out which one you want.
So, one solution here is to be specific
and that's by making use of the qualifier annotation.
And so, here's our coding here for our demo controller.
And everything looks the same except
for this one new entry here for qualifier.
So, here we give qualifier
and then we specify the bean ID of cricket coach.
Now the bean ID has the same name
as the class except for the first character as lowercase.
All right. So, that's how we come
up with cricket coach here, starting with lower case.
And this will actually resolve the issue
because now we're being very specific.
We're saying, hey, use cricket coach
as the injection for this given item.
And there's other bean IDs out there that we could use
such as baseball coach, track coach, or tennis coach.
But in this scenario here,
we're making use of the cricket coach.
Now that's for constructor injection.
For setter injection, you can do a similar thing.
You can also use the qualifier annotation.
And then, here's our code examples,
our normal setter method set coach
and then we specify qualifier annotation
and then give cricket coach.
Again, the bean ID is the same name as the class
except for the first character is lowercase.
All righty, this looks pretty good.
Let's go ahead and move into our (indistinct)
and let's write the code.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.