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
-: Now, let's just zoom out
for a second and let's run our application.
We see that um
we have a problem, right?
Things didn't work out.
It said application failed to start.
And if we can kind of expand our window here
for a bit and just scroll
through the log messages here.
Parameter zero of the constructor
required a single bean
but three were found.
Hmm, three.
Okay. Baseball,
Cricket, Tennis.
Hey, what about our track coach?
That's strange.
I, I thought, thought we had four.
It's a lot of, um
code that I wrote back there and
um only three.
Hmm.
What's up with that?
Let's take a look.
All right, so we have our baseball coach
we have our tennis coach,
we have our track
Oh, got it.
I forgot to add the component annotation here.
So remember the component annotation marks the class
as a spring bean
since it wasn't marked Spring
Couldn't find it.
Ah, got it.
Okay, cool.
Nice little learning exercise there.
All right
so this looks better now
uh, let's run our app one more time
and see how it works out.
Okay, uh
Application, uh
failed to start
uh, because of our parameter
of the constructor, but four were found.
And so basically we kind of broke it the way we
plan to break it, right?
We plan to break it
with four coach implementations, not three.
So anyway, it, it's broken as desired
here at the bottom to give us some actions that we
could possibly make use of
consider doing this stuff.
And it says, Hey, one of the options is making use
of qualifier annotation to identify the bean
that should be consumed.
Okay, great.
Well thanks for that hint
Let's go ahead and, uh
apply that and uh let's implement that hint.
I'll move into our demo controller here.
Expand the window for a second and zoom in.
And in my demo controller
I'll make use of that qualifier annotation.
So I'll specify the bean ID that I want
and I'll specify the bean ID of baseball coach.
So I'll use the same name as the class
except for the first character is lowercase.
So I'm being super specific saying
Use this implementation
of the coach interface.
Okay, great.
So now we can go ahead and run our application
and, uh see if we have any success
and great, so the application started successfully
All right, so that's good.
So we kind of resolved the whole ambiguity issue
and I can go over to my browser
localhost8080/dailyworkout
and I should get a baseball workout.
Great. So it says,
Hey, spend 30 minutes in batting practice.
And that's coming from our baseball coach implementation.
I like it.
This is really good.
And now let's swing back over and let's kind of
just change this up a bit, uh
based on some configuration here.
So instead of baseball coach,
I'd like to modify to make use
of Track Coach
and it should reload the new version
for me out there
and just do a reload on the browser over here
and run a hard 5k.
Great. I love it.
I love it.
So this is really good.
And then just to kind of set everything back to what we
what we originally had
we'll make use of this Cricket coach
as part of the qualifier here
and it makes sure that we actually load the
Cricket Coach implementation
practice our fast bowling
Awesome. So as you can see here
using a spring object factory spring container
we can actually configure how we want to use a given bean
and how we can inject a given bean based
on the configuration.
So this is really good.
I like to say good job my friend.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.