All language subtitles for 017 Primary - 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
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
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Instructor: This video will cover the primary annotation.

Now resolving the issue with multiple coach implementations,

we saw the example in the previous set of videos,

of, by making use of the qualifier annotation.

We were super specific, by mentioning a coach by name.

However, there's an alternate solution available.

Instead of specifying a coach by name,

using a qualifier annotation,

I could say, you know what?

I simply need a coach.

I don't care which coach.

And I could say, Hey, if there are multiple coaches

out there, then you coaches figure it out.

You all tell me who's the primary coach.

I really don't care.

I simply need a coach to help me out, here.

That's it.

So as before, we had our multiple coach implementations,

our track coach, baseball coach,

tennis coach, and cricket coach.

And then the one thing to notice here is,

that now we make use of this new annotation primary.

So this annotation basically says,

out of the multiple coach implementations, this is

going to be the primary implementation that you should use.

Now we can resolve this using the primary.

So here's our code for our demo controller.

And now one thing to notice here, with our demo controller,

and our constructor injection, is that there's no need

to use the qualifier annotation.

Because now, if there's multiple coaches,

we know the primary coach, based on that primary annotation,

that's on the track coach.

All right, so notice the difference, here.

There's one caveat, here.

When you are using the primary annotation, and you probably

was wondering about this, and thought about this.

When using the primary annotation can have only one

for multiple implementations.

If you mark multiple classes with primary, then hmm,

we have a little problem.

And when you run your application, if you try to

mark multiple classes with primary,

then, in the error messages it'll say, Hey,

more than one primary bean found.

So spring will say, I don't know what

you want me to do, here.

There's more than one primary.

I'm not sure which one to use, so I'm not going to start.

All right.

So just have to be aware of that.

You can only mark one class with primary.

Now, you may also wonder, well, what about

mixing primary and qualifier at the same time?

Can I use both of those in the same class?

The answer is yes, but you're asking for trouble.

Not really, but you have to be aware of this is,

that qualifier has the higher priority.

So even if you mention a given class as the primary class,

that can be overridden, or have higher priority,

by making use of the qualifier annotation.

So in this example here, qualifier has a higher priority.

So even though there's a primary coach, track coach,

this example will actually make use of cricket coach.

All right, so just something to be aware of.

And so you may wonder, well, which one should I use?

Should I use primary, or should I use qualifier?

Well, primary leads it up to the implementation classes.

You could have issues of multiple primary classes,

leading to an error.

Qualifier allows you to be very specific

on which bean you want.

And so in general, I recommend using qualifier,

and the reasoning is, is that it's more specific,

and it also has a higher priority,

compared to primary annotation.

This all looks pretty good.

Let's go ahead and move into the video, and let's go ahead

and write some code using the primary annotation.

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