Spring [combat] --1 Getting explain

This series is a learning spring summary of actual combat, on the one hand summed up the essence of the book is written, on the other hand sum up my feelings.

  

  The base portion of the spring to explain the best known of several functions: dependency injection / inversion control and Oriented Programming .

  These two not say any more, the function is relatively simple, there is no production of the sample, followed by further in-depth operating.

  

  Spring classes using POJO programming, which is a simple java object.

  Such spring benefits:

  Programming code for a lightweight and reduce invasion.

  2 Reverse loose coupling and dependency injection control.

  Based on section 3 and management, declarative programming.

  4 template, reducing code duplication.

 

  There are many containers in Spring, Bean plants are using in the past, but now basically use the application context.

  Here are some common application context loading:

  ClassPathXmlApplicationContext: xml file loaded by the class path, the most commonly used way that load bean.xml files in the src directory.

  FileSystemXmlApplicationContext: loading the configuration file by specifying the absolute path.

  XmlWebApplicationContext: read configuration files in the web application load.

  

  Bean's life cycle:

1 实例化
2 注入属性
3 BeanNameAware
4 BeanFactoryAware
5 ApplicationContextAware
6 BeanPostProcessor,ProcessBeforeInitialization
7 Initilalization
8 BeanPostProcessor,ProcessAfterInitialization
9 可以使用
10 DisposableBean destroy

 

  The figure is in several important spring modules:

 

Reproduced in: https: //my.oschina.net/u/204616/blog/545512

Guess you like

Origin blog.csdn.net/weixin_34184158/article/details/91990128