BE Study 5th
So, after all of those, the main question is who does execute the main() then?
TargetInterface target = new TargetImplement();
TargetInterface proxy = new Proxy(target);
Client client = new Client(proxy);
client.execute();
what does execute the above code that enables all the things? What 'injects the dependencies?'
The answer is spring itself. To be specific, it's spring container.
On the 3rd Study, I wrote like this.
What's 'Bean' and the 'Spring Container'?
Spring Container is a space that manages the bean, including their lifetime and giving extra functions. Bean is a java object that are used in Spring project. ApplicationContext is the most generally used Spring Container, which extends 'BeanFactory'.
Then how does the dependencies injected? The spring recognizes the class using annotations like @Autowired or @Component and wires them itself.
댓글
댓글 쓰기