Can I still not spring boot for an interview? How do I move into a big factory for a promotion and raise my salary?

Preface

Spring Boot is a brand new framework provided by the Pivotal team. Its design purpose is to simplify the initial setup and development process of new Spring applications. The framework simplifies configuration by agreeing on the principle of configuration. Spring Boot is committed to becoming a leader in the booming field of rapid application development. Spring Boot is currently widely used in major Internet companies and has the following characteristics:

  1. Create a standalone Spring application
  2. Embedded Tomcat, no need to deploy WAR file
  3. Simplify Maven configuration
  4. Automatic configuration of Spring
  5. Provides production-ready functions such as indicators, health checks and external configuration
  6. Absolutely no code generation, no configuration requirements for XML

And Spring Boot can be perfectly integrated with Spring Cloud and Docker, so it is very necessary for us to learn Spring Boot. And understand its internal implementation principles. Through this sharing, you can not only learn how to use Spring Boot, but also learn its internal implementation principles and have an in-depth understanding

What is SpringBoot?

 I care about what she is, as long as it is easy to use! ! ! But helplessly, I wrote "Proficient in SpringBoot" on my resume. . . It has to be roughly what SpringBoot is!

Spring believes that everyone has used it. The bunch of configurations are like: you want to eat, the rice is cooked, but you have to add oil, salt, sauce and vinegar by yourself (configuration), and you have to mix well before you can eat. ,

SpringBoot is different, just bring you a bowl of fragrant beef ramen, wow, so fragrant,,,, (well, I didn’t eat when I wrote this blog, just imagine it), you can just gobble it up. ? What? Do you want her to chew for you and feed you? ! ! ! Get out of you. . .

1. About Spring Boot

Before we start to understand Spring Boot, we need to understand Spring, because the birth of Spring Boot is closely related to Spring. Spring Boot is a product of Spring's development to a certain extent, but it is not a substitute for Spring. Spring Boot is to let Programmers use Spring better. Speaking of this, some people may be confused, but what kind of connection does Spring and Spring Boot have?

1. Spring history

Before we start, let’s get to know Spring. The predecessor of Spring is interface21. This framework was originally designed to solve the cumbersome and bloated problem of EJB development. It provided another simple and practical solution for J2EE, and it was released in March 2004. After the official version of Spring 1.0, it attracted widespread attention and hot comments in the Java industry. Since then, Spring has become a dazzling star in the Java industry. It has become irreplaceable and has become a real in J2EE development. The meaning of the standard, and his founder Rod Johnson also became famous afterwards, fame and fortune, and now is an excellent angel investor, embarked on the pinnacle of life.

2. Spring Boot is born

Now that Spring is so good, why is there still Spring Boot afterwards?

Because Spring has become more and more popular with the development of Spring, Spring has gradually changed from a small and sophisticated framework to a framework with a wide and comprehensive coverage. On the other hand, with the development of new technologies, such as nodejs, golang, and Ruby The rise of Spring has gradually become cumbersome. A large number of cumbersome XML configurations and third-party integrated configurations have made Spring users painful. At this time, a solution is urgently needed to solve these problems.

At this moment, Spring Boot came into being. Spring Boot began its research and development in 2013, and Spring Boot 1.0 was officially released in April 2014. Since its birth, Spring Boot has received widespread attention from the industry. Many individuals and companies have begun to try. The release of Spring Boot 2.0 has once again pushed Spring Boot into the public eye, and more and more medium and large enterprises are using Spring Boot in a formal production environment. It is worth mentioning that Spring officials also put Spring Boot as the primary promotion project and put it at the top of the official website.

3. Introduction to Spring Boot

Spring Boot is a brand new framework provided by the Pivotal team. Its design purpose is to simplify the initial setup and development process of Spring applications. The framework uses a specific way to configure, so that developers no longer need to define boilerplate configurations. Spring Boot is actually a framework that integrates many pluggable components (framework) with embedded tools (such as embedded Tomcat, Jetty, etc.), which is convenient for developers to quickly build and develop.

The above explanation is to facilitate understanding and deepen memory. . . Let's take a look at the official introduction:

 
  1. Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".

  2.  
  3. We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.

I can't help but want to translate:

 
  1. Spring Boot使创建独立的、基于生产级Spring的应用程序变得很容易,您可以“直接运行”这些应用程序。

  2.  
  3. 我们对Spring平台和第三方库有自己的见解,这样您就可以轻松入门了。大多数Spring引导应用程序只需要很少的Spring配置。

In general, it means that she is really easy to use, she can save you a lot of tedious configuration when setting up the service, and the experience after using it: "It's like a dead dog". . .

4. Spring Boot features

  • The project is built quickly, and it can be completed in a few seconds;
  • Make testing simple, built-in multiple testing frameworks such as JUnit, Spring Boot Test, etc., to facilitate testing;
  • Spring Boot makes configuration simple. Spring Boot's core concept: agree on configuration, agree on a certain naming convention, and you can complete function development without configuration. For example, if the model and table name are consistent, you can directly perform CRUD without configuration ( Add, delete, modify, check) only when the table name is inconsistent with the model, configure the name;
  • Built-in container saves the cumbersome configuration of Tomcat;
  • Convenient monitoring, using the Spring Boot Actuator component to provide system monitoring of the application, you can view the detailed information of the application configuration;

2. Development environment

Spring Boot 2.0.4

JDK 1.8

IDE:IntelliJ IDEA 2018.2

Note: Spring Boot 2.x requires Java8 and above, and no longer supports Java6 and Java7.

Three, development tools

IntelliJ IDEA Vs MyEclipse

The choice of development tools is something that every beginner has to experience and choose. If you are a veteran, you can ignore this section.

Once upon a time, Eclipse and MyEclipse ruled Java users, but now, year after year, it is unceremonious to say that from 10 years ago I used MyEclipse 6.0 to the current MyEclipse 2017, I don’t feel any changes. I still have the same skin. The layout of the card is the same as the take-off experience of the card. Even after optimizing a bunch of configurations in accordance with Google's guidelines, you will find little effect.

This reminds me of Nokia, which was once glorious. It still doesn't know what it did wrong until today, but when the time has passed, when a thing cannot keep up with the changing rhythm of the times, it will be replaced by something new and more suitable. I have to say that I was also a loyal lover of MyEclipse, and once a person accepts something, it is usually difficult to change due to the effect of habit.

However, to this day, I have to admit that IntelliJ IDEA is much better than MyEclipse in terms of appearance and running speed. Especially in terms of support for Spring Boot, it is a better fit, so IntelliJ IDEA is the best choice.

Four, Spring Boot version number description

The SpringBoot version on the official website is listed below:

What does the English after the version number mean?

The specific meaning is as follows:

  • SNAPSHOT: Snapshot version, which means the development version, which may be modified at any time;
  • M1 (Mn): M is the abbreviation of milestone, which is the milestone version;
  • RC1 (RCn): RC is the abbreviation of release candidates, that is, release preview version;
  • Release: the official version, it may also indicate the official version without any suffix;

Five, springBoot core functions

☆   Independent running spring project: Spring Boot can be run directly in the form of jar package, such as java-jar xxxjar. The advantage is: save server resources

☆   Embedded servlet container: Spring Boot can choose to embed Tomcat, Jetty, so we don't need to deploy the project in the form of war package.

☆   Provide starter to simplify Maven configuration: In the Spring Boot project, we have provided us with a lot of spring-boot-starter-xxx projects (we call this dependency a start-up dependency ), and we import the coordinates of these designated projects. The dependency package related to the module will be automatically imported:
       for example, we need to import the dependency of the spring-boot-starter-web project when we use Spring Boot for web development in the later period. After importing this dependency! Then Spring Boot will automatically import other dependency packages needed for web development, as shown in the following figure:

☆   Automatic configuration of spring: Spring Boot will automatically configure Beans for the classes in the jar package according to the jar packages and classes in the classpath, which will greatly reduce the configuration we need to use.
  Of course, Spring Boot only considers most of the development scenarios, not all scenarios. If we need to automatically configure the Bean in actual development, and Spring Boot cannot meet the requirements, we can customize the automatic configuration.
☆Pre   -production application monitoring: Spring Boot provides monitoring of runtime projects based on http, sh, and telnet

☆   No code generation and xml configuration: Spring Boot makes extensive use of the new annotation features provided by spring 4.x to achieve no code generation and xml configuration. Spring 4.x advocates the use of a combination of Java configuration and annotation configuration, while Spring Boot does not require any xml configuration to implement all spring configurations.

How is the automated configuration done?

Spring boot provides us with a lot of conditional annotations to complete

6. Supplementary content:

What the hell! ? You still don't understand? Want to know her more "in-depth"? Okay, then I'll post something to you (it's a bit messy, you can just look through it):

On the morning of March 1, 2018, Beijing time, there was a problem with the Spring Boot 2.0
released as scheduled when it was synchronized to the Maven repository, which caused the v2.0.0.RELEASE released on GitHub to be withdrawn. After the problem was fixed, Spring Boot 2.0 was officially re-released
and the Maven central warehouse address was provided. So far, Spring Boot 2.0 is officially launched!

According to the official, this version has gone through 17 months of development, and 215 different users have provided more than 6,800 submissions. Many thanks to
everyone who contributed, and all early adopters who provided important feedback on these milestone releases.

This version is the first major revision since Spring Boot 1.0 was released 4 years ago, and it is also the first
GA stable version to provide support for Spring Framework 5.0 .
Where can I find SpringBoot?

Very good, this classmate has a good question! :

 

 how about it? Familiar with this place, yes, this is the Spring family, SB (SpringBoot, and the blog referred to as SB in the future ) is also one of the members, you can regard her as a good friend of Spring (●'◡'●)ノ*\ (๑•₃•๑)*Or girlfriends, whatever. . . In short, she made it very convenient for us to deal with Spring.

In addition, after SpringBoot2.X, it is really a big change:

Highlights of the new version worthy of attention:

1. It is based on Java 8 and supports Java 9, which means that it is not that JDK7 or older JDK versions can not be used to run SpringBoot2, but JDK8+ is officially recommended. You can figure out whether to use it or not. . . .

2. Support Quartz scheduler

3. Greatly simplifies safe automatic configuration

4. Support embedded Netty

5.Tomcat, Undertow and Jetty all support HTTP/2

6. Brand new actuator architecture, support Spring MVC, WebFlux and Jersey

7. Use Spring WebFlux/WebFlux.fn to provide responsive Web programming support

8. Provides automated configuration for reactive programming of various components, such as: Reactive Spring Data, Reactive Spring Security, etc.

9. Automatic configuration and starter POM for reactive Spring Data Cassandra, MongoDB, Couchbase and Redis

10. Introduce support for Kotlin 1.2.x, and provide a runApplication function, allowing you to run Spring Boot applications through idiomatic Kotlin. For more information, please refer to the Kotlin support section in the reference document

11. The ASCII image Spring Boot banner at startup now supports GIF.
For example:

It is worth noting that in Spring Boot 2.0, many configuration properties have been renamed or deleted. In order to facilitate the upgrade, Spring Boot has released a new spring-boot-properties-migrator module. As long as it is added as a dependency to the project, it will not only analyze the environment of the application and print diagnostic information at startup, but also temporarily migrate the properties to the new configuration mode for the project during the runtime phase.

During the program migration to springboot2.0, this module is necessary

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
</dependency>

Note: After the migration is complete, make sure to remove the module from the dependencies of the project.

The last benefit from the editor

The following is the essential [Spring Family Bucket] data package and Alibaba interview highlights compiled by the editor . Those who need to receive it can click me to receive it for free . The world of programming is always open to all those who love programming. This is A free, equal, and shared world, I have always believed in this way.  

Part of the profile picture:

Guess you like

Origin blog.csdn.net/QLCZ0809/article/details/111174232