1、Spring is an open source framework, and Spring was launched in 2003 as a lightweight Java development framework created by Rod Johnson. In a nutshell, Spring is a hierarchical, JavaSE/EEfull-stack(one-stop)lightweight opensourceframework. Thepowerful JavaBeans based configuration management using th
2、e Inversion of Control (IoC) principle makes application components faster and easier.1. facilitate decoupling and simplify developmentThrough the IoC container provided by Spring, we can control dependencies between objects by Spring, avoiding excessive program coupling caused by hard coding. With
3、Spring, users do not have to write code for the bottom tier requirements of single instance schema classes, properties, file parsing, and so on, and can focus more on top tier applications.2. AOP programming supportThrough the Spring functionality provided by AOP, it is easy to implement face orient
4、ed programming, and many features that are not easily implemented with traditional OOP can be easily handled by AOP.3. declarative transaction supportIn Spring, we can extricate ourselves from tedious and tedious transaction management code and flexibly manage the transaction through declarative man
5、ner, so as to improve the efficiency and quality of development.4. convenience program testingAlmost all test work can be done in a non container dependent programming manner, and in Spring, testing is no longer expensive, but something to do. For example, Spring supports Junit4 and can easily test
6、Spring programs by annotations.5. convenient integration of various excellent frameworkSpring does not exclude all kinds of excellent open source framework, on the contrary, Spring can reduce the difficulty of the use of Spring framework, provides a framework for a variety of excellent (such as Stru
7、ts, Hibernate, Hessian, Quartz) directly support the.6. reduce the difficulty of using Java EE APISpring provides a thin layer of encapsulation for many difficult Java, EE, API (such as JDBC, JavaMail, remote calls, etc.), and the use of these Java EE API isgreatly reduced through the simple package
8、 of Spring.7. Java source code is a classic example of learningSpring source code, clear structure, exquisite design originality, embodies the master of the Java design pattern and the flexible use of Java technology accomplishment. Springframework source code is undoubtedly the best practice exampl
9、e of Java technology. If you want to quickly improve your Java skills and application development level in a short time, learning an.The role of MVC - Spring is integration, but not just integration, and the Spring framework can be seen as a framework for enterprise solution levels. The client sends
10、 a request, the server controller (implemented by DispatcherServlet) to complete the request forwarding, call a controller for mapping class HandlerMapping, the class isused to map requests to the corresponding processor to process the request. HandlerMapping will request is mapped to the correspond
11、ing processor Controller (equivalent to Action) in Spring if you write some processor components, the general implementation of the Controller interface in Controller, you can call Service or DAO to operate data from the DAO ModelAndView used to store the retrieved data, some data can also be stored
12、 in response to the view. If you want to return the result to the user, it also provides a view of ViewResolver component in Spring framework, the component labeled Controller returns according to, find the corresponding view, the response response back to the user.Each module (or component) that ma
13、kes up the Spring framework can exist alone, or can be implemented in conjunction with one or more other modules. Each module has the following functions: 1, the core container: the core container provides the basic functionality of the Spring framework (Spring, Core). The main component of the core
14、 container is BeanFactory, which is implemented in factory mode. BeanFactory uses the control inversion (IOC) pattern to separate application configuration and dependency specifications from the actual application code.Spring 框架Spring 是一个开源框架,Spring 是于 2003 年兴起的一个轻量级的 Java 开发框架, 由Rod Johnson 创建。简单来说
15、,Spring 是一个分层的 JavaSE/EEfull-stack(一站式) 轻量级开源框架。强大的基于 JavaBeans 的采用控制反转(Inversion of Control,IoC) 原则的配置管理,使得应用程序的组件更加快捷简易。1. 方便解耦,简化开发通过 Spring 提供的 IoC 容器,我们可以将对象之间的依赖关系交由 Spring 进行控制,避免硬编码所造成的过度程序耦合。有了 Spring,用户不必再为单实例模式类、属性文件解析等这些很底层的需求编写代码,可以更专注于上层的应用。2. AOP 编程的支持通过 Spring 提供的 AOP 功能,方便进行面向切面的编程,
16、许多不容易用传统 OOP实现的功能可以通过 AOP 轻松应付。3. 声明式事务的支持在 Spring 中,我们可以从单调烦闷的事务管理代码中解脱出来,通过声明式方式灵活地进行事务的管理,提高开发效率和质量。4. 方便程序的测试可以用非容器依赖的编程方式进行几乎所有的测试工作,在 Spring 里,测试不再是昂贵的操作,而是随手可做的事情。例如:Spring 对 Junit4 支持,可以通过注解方便的测试 Spring 程序。5. 方便集成各种优秀框架Spring 不排斥各种优秀的开源框架,相反,Spring 可以降低各种框架的使用难度,Spring 提供了对各种优秀框架(如 Struts,Hibernate、Hessian、Quartz)等的直接支持。6.降低 Java EE API 的使用难度Spring 对很多难
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1