In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Spring core framework architecture is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Many people are using spring to develop java projects, but when configuring maven dependencies, it is not clear which spring jar should be configured, often adding a bunch randomly, compiling or running errors will continue to configure jar dependencies, resulting in spring dependency confusion, and even the next time to create the same type of project do not know which spring dependencies to configure, only copy, in fact, that's what I did!
There are only about 20 jar packages in spring, each with corresponding functions, and a jar may also rely on several other jar, so it is easy to figure out the relationship between them and configure maven dependency. for example, what jar is required to use the spring framework in an ordinary java project? Just one.
Org.springframework spring-context 3.2.17.RELEASE
What about introducing spring mvc into the web project? As long as you configure a dependency
Org.springframework spring-webmvc 3.2.17.RELEASE
Why can it be configured in this way? Next, we will take the spring 3.2.17.RELEASE version as an example to introduce the spring framework structure. Spring 4 is slightly different and will be introduced in *.
The official website of spring gives a structure diagram of spring3.
In the figure, the spring is divided into five parts: core, aop, data access, web, and test. Each rounded rectangle in the figure corresponds to a jar. If configured in maven, the "groupId" of all these jar is "org.springframework", and each jar has a different "artifactId". In addition, "instrumentation" has two jar and a "spring-context-support" figure is not listed, so there are a total of 19 jar packets for spring3.
The jar and dependencies of these five parts are described below.
Core
The core section contains 4 modules
Spring-core: the most basic implementation of dependency injection IoC and DI
The assembly of spring-beans:Bean factory and bean
The context context of spring-context:spring is the IoC container
Spring-expression:spring expression language
Their complete dependencies
Because spring-core depends on commons-logging and other modules rely on spring-core, the whole spring framework depends on commons-logging. If you have your own log implementation such as log4j, you can eliminate the dependence on commons-logging, exclude commons-logging dependency without log implementation, and compile errors.
Org.springframework spring-context 3.2.17.RELEASE commons-logging commons-logging
Aop
The aop section contains 4 modules
Spring-aop: aspect-oriented programming
Spring-aspects: integrated AspectJ
Spring-instrument: provides some class-level tool support and ClassLoader-level implementation for servers
Spring-instrument-tomcat: instrument implementation for tomcat
Their dependencies
Data access
The data access section contains 5 modules
Support for spring-jdbc:jdbc
Spring-tx: transaction control
Spring-orm: object-relational mapping, integrated orm framework
Spring-oxm: object xml mapping
Spring-jms:java message service
Their dependencies
Web
The web section contains 4 modules
Spring-web: basic web functions, such as file upload
Spring-webmvc:mvc implementation
Spring-webmvc-portlet: mvc implementation based on portlet
Spring-struts: integration with struts, not recommended, spring4 is no longer available
Their dependencies
Test
There is only one module in the test section. I'll put the spring-context-support here, too.
Spring-test:spring testing, providing junit and mock testing functions
Additional support packages for spring-context-support:spring, such as mail service, view parsing, etc.
Their dependencies
This is the end of the introduction to spring3. Looking at these pictures, I'm sure there will be no more confusion when you configure spring dependencies in maven.
Here is an introduction to spring4, which is basically the same as spring3. Here is the structure diagram given on the official website.
As you can see, the struts of spring3 is removed, messaging and websocket are added, and other modules remain unchanged, so there are 20 jar for spring4.
Spring-websocket: an efficient communication tool for web applications
Spring-messaging: used to build message-based applications
Their dependencies
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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: 0
*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.