- 1、本文档共24页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
spring(春天)
spring(春天)
What is the spring framework
Spring is the J2EE application framework, lightweight containers of IoC and AOP framework, mainly for the javaBean to manage the life cycle of lightweight containers, can use alone, also can and Struts framework, ibatis framework combination, etc.
2. Overview of architecture
1) IoC Inversion of Control (Inversion of Control), object creation responsibility Inversion, in spring BeanFacotory is the core of the IoC container interface, is responsible for the instantiation, positioning, configuration of objects in the application and establish the dependencies between objects. XmlBeanFacotory implements the BeanFactory interface, which makes up the dependencies between the application object and the object by retrieving the XML configuration file data.
There are three injection modes in spring, one is set injection, one is the interface injection, the other is the construction method injection.
2) AOP is oriented towards the cutting surface programming
Aop is longitudinal programming, as shown in the figure below, the business 1 and 2 requires a common operations, rather than add the same code, every business is better than to write the code again, let two business using this code.
There are two ways to implement the facets in spring, one is the dynamic proxy, the other is CGLIB, the dynamic proxy must provide the interface, and the CGLIB implementation is inherited.
3. Why use the spring framework
Before we can use the spring framework, we have to use the object of the dao layer in our service layer and have to have a new object in the service layer. As follows:
[Java] view plaincopyprint? See the CODE snippet on CODE that is derived from my CODE slice
/ / the dao layer object
Public class UserDao {
Publicvoid insert (User User) {}
}
/ / service layer objects
Public classUserService {
Publicvoid insert (User User) {
UserDaouserdao = new UserDao ();
Userdao. Insert (user);
}
}
Existing problems: dependencies between layers and lay
您可能关注的文档
- ABB变频器资料及维护和保养 - 使用维护 - 设备管理网(ABB inverter information and maintenance and maintenance - use maintenance - device management network).doc
- ABBjieshao(ABBjieshao).doc
- abba线性滑轨,推荐安昂丝杆选型(Abba linear slide track, recommend the anonscrew selection).doc
- abb变频器(Abb inverter).doc
- ABS汽车外饰件涂装(Coating of exterior of ABS car).doc
- acad 超快选图元 ,超级炸开 ,匿名块操作(Acad super fast pictograph, super burst open, anonymous block operation).doc
- ABS测试方法(ABS test method).doc
- ADINA中的坐标系及其用途用法(The frame and its use in ADINA).doc
- 7高级电工技师理论复习题-电工考试题库-电工试题库7-百科网络(7 senior electrician technician theoretical review - electrician test - electrician test library 7 - encyclopedia network).doc
- adsl灯亮故障(Adsl light glitches).doc
- share memory(共享内存).doc
- sql server全局变量(SQL server global variables).doc
- SqlServer2008 考试范围(SqlServer2008 exam scope).doc
- SQL命令建库建表(SQL command builds tables).doc
- sqlserver存储过程(SQL server stored procedures).doc
- sql数据库的特殊指令(Special instructions for SQL databases).doc
- SQL数据库面试题(SQL database interview questions).doc
- SQL基础测试题(SQL base test questions).doc
- sql文本文档(SQL text document).doc
- SQL面试题四(SQL interview question 4).doc
文档评论(0)