Spring Sequence1
Spring Sequence1
Why Spring ?
Simplifies overall java development
What is it ?
container --manages life cycle of spring beans
(spring bean --- java obj whose life cycle completely managed by SC(spring
container)
eg : rest controller, controller, service,DAO.
framework --rdy made implementation of std
patterns(eg :MVC,Proxy,singleton,factory, ORM ...)
Why --Any time the nature of the dependency changes , dependent obj is affected(i.e
u will have to make changes in dependent obj)
eg : When the dependency of Java Bean changes from JDBC Based DAO to Hibernate
based DAO , in case of user authentication , javabean class has to be modified to
handle invalid login case(i.e handle NoResultException)
eg : UserController
@Autowired
private UserService service;
API
How to get ready to use spring beans from SC ?
API of BeanFactory
public <T> T getBean(String beanId,Class<T> beanClass) throws BeansException
Spring bean life cycle
Types of wiring