All language subtitles for 014 Qualifiers - Overview_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese Download
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:01,200 --> 00:00:02,940 Instructor: In this video will cover Annotation 2 00:00:02,940 --> 00:00:05,283 Autowiring and Qualifiers. 3 00:00:09,360 --> 00:00:10,230 For auto wiring, 4 00:00:10,230 --> 00:00:12,360 we're injecting a coach implementation. 5 00:00:12,360 --> 00:00:14,520 So, Spring will scan for components, 6 00:00:14,520 --> 00:00:17,700 check to see if anyone implements a given coach interface. 7 00:00:17,700 --> 00:00:19,500 If so, let's inject them. 8 00:00:19,500 --> 00:00:23,051 But if we have multiple implementations, which one, 9 00:00:23,051 --> 00:00:26,460 like what algorithm will Spring use to determine 10 00:00:26,460 --> 00:00:28,743 which coach that it should implement? Hmm. 11 00:00:31,770 --> 00:00:32,790 So, here's a diagram here 12 00:00:32,790 --> 00:00:34,740 of our multiple coach implementations. 13 00:00:34,740 --> 00:00:36,990 So, we have coach, cricket coach, 14 00:00:36,990 --> 00:00:40,143 baseball coach, track coach, tennis coach, et cetera. 15 00:00:43,650 --> 00:00:45,630 And then, we have the actual source code 16 00:00:45,630 --> 00:00:47,370 for these implementations. 17 00:00:47,370 --> 00:00:51,330 So, we have our cricket coach, baseball, track and tennis. 18 00:00:51,330 --> 00:00:52,926 All implement the coach interface. 19 00:00:52,926 --> 00:00:55,140 So, when we ask for a coach implementation, 20 00:00:55,140 --> 00:00:56,673 which one will Spring pick? 21 00:00:59,190 --> 00:01:01,503 Well, we have a little problem. 22 00:01:02,460 --> 00:01:04,170 So, this is the error message that you'll actually 23 00:01:04,170 --> 00:01:06,930 encounter when you run your application. 24 00:01:06,930 --> 00:01:10,200 Spring will say there's a parameter zero of the constructor 25 00:01:10,200 --> 00:01:13,260 and the controller required a single bean, 26 00:01:13,260 --> 00:01:15,060 but four were found. 27 00:01:15,060 --> 00:01:17,250 Okay so, I need a coach, 28 00:01:17,250 --> 00:01:18,990 but there's too many of them out here. 29 00:01:18,990 --> 00:01:20,910 And at this point, Spring will not start up. 30 00:01:20,910 --> 00:01:22,290 The application will not start 31 00:01:22,290 --> 00:01:24,240 because there's too much ambiguity. 32 00:01:24,240 --> 00:01:26,823 Spring can't figure out which one you want. 33 00:01:30,600 --> 00:01:32,850 So, one solution here is to be specific 34 00:01:32,850 --> 00:01:35,500 and that's by making use of the qualifier annotation. 35 00:01:37,110 --> 00:01:40,500 And so, here's our coding here for our demo controller. 36 00:01:40,500 --> 00:01:41,700 And everything looks the same except 37 00:01:41,700 --> 00:01:44,550 for this one new entry here for qualifier. 38 00:01:44,550 --> 00:01:46,380 So, here we give qualifier 39 00:01:46,380 --> 00:01:49,680 and then we specify the bean ID of cricket coach. 40 00:01:49,680 --> 00:01:52,140 Now the bean ID has the same name 41 00:01:52,140 --> 00:01:56,040 as the class except for the first character as lowercase. 42 00:01:56,040 --> 00:01:57,000 All right. So, that's how we come 43 00:01:57,000 --> 00:01:59,370 up with cricket coach here, starting with lower case. 44 00:01:59,370 --> 00:02:00,660 And this will actually resolve the issue 45 00:02:00,660 --> 00:02:02,190 because now we're being very specific. 46 00:02:02,190 --> 00:02:04,320 We're saying, hey, use cricket coach 47 00:02:04,320 --> 00:02:06,543 as the injection for this given item. 48 00:02:07,900 --> 00:02:10,020 And there's other bean IDs out there that we could use 49 00:02:10,020 --> 00:02:12,660 such as baseball coach, track coach, or tennis coach. 50 00:02:12,660 --> 00:02:13,920 But in this scenario here, 51 00:02:13,920 --> 00:02:15,820 we're making use of the cricket coach. 52 00:02:19,530 --> 00:02:22,080 Now that's for constructor injection. 53 00:02:22,080 --> 00:02:24,360 For setter injection, you can do a similar thing. 54 00:02:24,360 --> 00:02:26,673 You can also use the qualifier annotation. 55 00:02:29,670 --> 00:02:31,050 And then, here's our code examples, 56 00:02:31,050 --> 00:02:33,450 our normal setter method set coach 57 00:02:33,450 --> 00:02:36,240 and then we specify qualifier annotation 58 00:02:36,240 --> 00:02:37,530 and then give cricket coach. 59 00:02:37,530 --> 00:02:40,290 Again, the bean ID is the same name as the class 60 00:02:40,290 --> 00:02:42,993 except for the first character is lowercase. 61 00:02:44,280 --> 00:02:45,330 All righty, this looks pretty good. 62 00:02:45,330 --> 00:02:46,740 Let's go ahead and move into our (indistinct) 63 00:02:46,740 --> 00:02:48,243 and let's write the code. 4929

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.