Hi guys, sino po nakakaalam kung paano gamitin ang mga annotation sa spring (ex. @AutoWired, bean, etc..) yung may sariling explanation sana hindi yung galing sa google. Thank you
Hi guys, sino po nakakaalam kung paano gamitin ang mga annotation sa spring (ex. @AutoWired, bean, etc..) yung may sariling explanation sana hindi yung galing sa google. Thank you
Instead of Googling, you should read the official Spring docs and their example projects. Those are way better than just raw Googling. Have you tried that yet?
@Autowired is a magical way to use something later
even though you don't have it right now (Someone will provide you a spoon later)
even though you don't know how it's done (You don't care how a spoon is made. You just need a spoon)
even though you don't know how it will get to you (You will get a spoon but you don't know how you will get one but trust me you will get one)
It's like you when are about to eat in a restaurant. You expect there are plates, forks, spoons, knives etc. You need those tools. You know more than likely where they will be on the table. You can trust the restaurant to provide you those.
bean is basically a way to declare something so it can be magically referenced by the @Autowired. It's like you expect something but the guy who will provide you that something later is the waiter. The waiter is made via bean.