Detailed interpretation of Spring

Table of contents

1. History of Spring

2. The core technology of Spring:

3. Spring's official website: spring.io

4. The characteristics of Spring

5. How to understand the framework

6. What is IOC

7. Benefits of IOC:

8. Among the knowledge learned before, the realization of IOC is similar to: Servlet

9. What kind of project can be regarded as a Spring project?


1. History of Spring

Spring technology appeared in 2002. Its appearance solved the difficulty of enterprise development, eased the management between project modules and between classes, and helped developers create objects and manage the relationship between objects.

2. The core technology of Spring:

  • IOC (Inversion of Control)
  • AOP (Aspect Oriented Programming)

The above two core technologies are able to achieve decoupling and integration between modules and classes.

Supplement: What is dependency in java learning?

Dependency: That is, the properties or methods of class B are used in class A, which is called class A depends on class B.

The Spring technology is to manage dependencies. When you use A, it will automatically help you operate class B.

Here is a reminder: maven is the jar package that manages the entire module, while Spring manages the classes and methods in the module.

3. Spring's official website: spring.io

On the official website, we can see the detailed introduction of Spring's core technology under the Reference Doc directory.

See the detailed introduction of Spring's various classes in the API Doc directory.

Note: Spring technology is open source.

4. The characteristics of Spring

  • Lightweight: The jars used by spring are relatively small, generally below 1M or hundreds of kb. The total jar package required by Spring core functions is about 3M.
  • For interface programming, achieve decoupling and (that is, use IOC).
  • AOP programming support
  • Easy to integrate various excellent frameworks

5. How to understand the framework

A: A framework is a piece of software that is written by someone else.

We should understand:

  • What does this framework do, that is, what is the role of this framework
  • The syntax of the framework, what steps need to be followed by the framework to complete a function
  • After you are familiar with the basic use of the framework, consider understanding the internal implementation of the framework
  • At the Dacheng stage, you can try to write the framework yourself

6. What is IOC

Answer: IOC is Inverse of Control (Inversion of Control). It is a concept and an idea. Its implementation includes dependency injection and annotation. After using IOC, programmers can hand over the management work to containers outside the code. That is to say, after we implement IOC technology, we can create objects, wait for some work, and let the container help We are done, no longer created by the programmers one by one.

7. Benefits of IOC:

The most prominent advantage of IOC is that when we change the requirements later, we can implement new requirements with minimal code modification.

8. Among the knowledge learned before, the realization of IOC is similar to: Servlet

9. What kind of project can be regarded as a Spring project?

Answer: The Spring project is created according to the requirements of Spring.

If it is a Spring project, the files we usually see are:

  • applicationContext.xml file
  • dao package, service package,
  • In the pom file, you can see org.springframework,,, spring-context dependencies 

Guess you like

Origin blog.csdn.net/weixin_44362089/article/details/127320456