In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to carry out the conceptual analysis of Spring, I believe that many inexperienced people are at a loss about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
1.1 Overview of Spirng
The founder of Spring: Rod Johnson has a bachelor's degree in computer science from the University of Sydney and a doctorate in musicology. Perhaps the cell of music inspired its programming aesthetics and enabled him to achieve the simplicity and elegance of Spring.
From artistic aesthetics to procedural aesthetics, there are not only the founder of Spring, but also the founder of Vue (Evan You), one of the three mainstream frameworks in the front end. Evan You received a master of art degree from Design & Technology, which may be precisely because of this spirit of pursuing the beauty of design, which promoted the birth of Vue.
Version 1.0 was released on March 24, 2004.
1.2 about SpringSource
Rod Johnson founded SpringSource with his backbone team when Spring 1.0 was released, and successfully carried out a number of sub-projects representing different technical areas based on Spring's open source framework.
In May 2007, SpringSource attracted Benchmark Capital venture capitalists.
In 2008, SpringSource acquired G2One (the Groovy programming language) and Grails Web,Covalent (the company that supports Apache's Tomcat application server).
In 2009, SpringSource acquired Hyperic, an open source system testing company. The core product of Hyperic is Hyperic HQ, which provides availability testing of hardware and operating systems, virtual machines, databases and application servers.
On August 11, 2009, VMware acquired SpringSource.
In 2012, Spring founder Rod left SpringSource and VMware.
In 2013, the SpringSource team released version 4.0 of Spring Framework.
1.3 what does Spring bring us?
EJB is complex and difficult to learn and test, so a framework that is easy to use, easy to develop and easy to test arises at the historic moment. Spring is born and takes the essence of EJB.
The benefits of Spring:
1. Easy to decouple, simplify development, and provide an IoC container.
2. Support for AOP programming.
3. Support for declarative transactions.
4. Convenient program testing.
5. It is easy to integrate all kinds of excellent frameworks.
6. Reduce the difficulty of using Java EE API.
7. Spring source code is a classic learning case.
1.4 Spring architecture
IoC and AOP are the foundations on which Spring depends. It mainly consists of the following five parts:
1. IoC
The core function of Spring implements the function of IoC, which separates the dependency between classes from the code and describes the dependency relationship in the way of configuration. The IoC container is responsible for the creation, splicing, management and acquisition of dependent classes.
BeanFactory interface is the core interface of Spring framework.
The Context module is built on top of the core module, extending the functions of BeanFactory; for example, adding i18n internationalization, Bean life cycle control, framework event system, resource loading transparency and other functions.
ApplicationContext is the core interface of Context module.
2. AOP
AOP is one of the technologies that have a great influence on programming ideas after OOP. Java 5.0introduces java.lang.instrument, which allows a proxy class to be enabled when JVM is started. Through the proxy class, the bytecode of the class is modified at run time, and the function of a class is changed, thus realizing the function of AOP.
3. Data access and integration
Spring stands at the abstract level of DAO and establishes a set of unified exception system for DAO layer. At the same time, it converts all kinds of check-type exceptions to non-check-type exceptions, which provides a basis for integrating various persistence layer frameworks. In this way, Spring establishes a unified DAO layer independent of data form and access technology, and with the help of AOP technology, Spring provides the function of declarative transactions.
4. Web and remote operation
This module is based on the Application Context module and provides various tool classes for Web applications, such as initializing the Spring container through Listener or Servlet and registering the Spring container into the Web container. It also provides Web-oriented features, such as FreeMarker,Velocity, and can integrate MVC frameworks such as Struts and WebWork.
5. Web and remote access
Spring itself provides a complete MVC framework similar to Struts, called SpringMVC. If you do not want to use SpringMVC, then Spring's integration of MVC frameworks such as Struts and WebWork can bring convenience. Compared with Servlet's MVC,Spring, it has also done a lot of work in simplifying Portlet development.
6. WebSocket
WebSocket provides an efficient and two-way communication in Web applications, which needs to take into account the high-frequency and low-latency message exchange between the client and the server, such as online transactions, games, collaboration, data visualization and so on. In addition, Spring provides the integration of many famous frameworks on remote access and Web Service.
1.5 Spring requirements for Java version
Spring4.0 is based on Java 6.0 and fully supports Java 8.0. To run Spring 4, you must use a version above Java 6. 0. It is recommended to use Java 8. 0 or above. If you want to compile Spring 4. 0, you must use Java 8. 0.
1.6 what's new in Spring 4.0
Fully support Java SE 8, Java EE 7, and backward compatibility to Java SE 6 / Java EE 6, remove obsolete classes, add features such as generic dependency injection, Lambda expressions, Groovy DSL definition Bean, core container enhancements, Web framework enhancements, WebSocket module implementation, testing enhancements, etc., fully support REST style development.
1.6.1 full support for Java 8.0
1. What's new in Java 8.0
1) Lambda expression for Java 8.0
2) time and date of Java 8.0 API
3) repeated annotation support
4) Null pointer Terminator: Optional, some objects will never be empty, so it is unnecessary to make a non-null judgment.
1.6.2 enhancements to core containers
Spring 4.0supports generic dependency injection
1. @ Autowired
Portected BaseDao dao
2. @ Autowired
Private Map map
3. @ Lazy delay injection
4. @ Conditional: similar to @ Profile, it generally switches configurations in multiple environments (development and production environments)
5. CGLIB proxy class enhancement: in Spring 4.0, CGLIB-based proxy classes no longer require that the class must have an empty parameter constructor
1.6.3 support defining Bean with Groovy
Groovy has many shortcomings, such as unfriendly error prompts and high learning curve.
1.6.4 enhancements to Web
@ RestController, which is convenient for REST development, and adds an AsyncRestTemplate to support asynchronous non-blocking requests from REST clients
1.6.5 support for WebSocket
Two-way communication (online transactions, games, collaboration, data visualization), browser IE
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 235
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.