The basics of Spring Boot

The basics of Spring Boot

 

The position of spring Boot in the Spring ecosystem:


Its core is: constraints are greater than configuration

I want to liberate programmers from configuration as much as possible and develop projects more quickly.

 

 

 

Spring Boot learning requirements

      1. Spring Basics

      2. Maven/Gradle

      3. Git

      4. Docker

      5. Docker Compose

 

    To learn spring boot, it is best to have the foundation of using Spring. Of course, spring boot itself can also allow you to quickly get started and use it, but as mentioned above, once you encounter problems, you will become very passive without the foundation of spring use. , plus there are very few documents, there is basically no bug information on the Internet, so you understand; then you are required to know how much Maven or grade configuration, spring boot is based on these to achieve project dependency management; finally, talk about IDE tools, which It is also a personal usage habit. I personally recommend that everyone learn to use IntelliJ IDEA. Although it is different from the commonly used Eclipse tools, its indexing mechanism will make our development experience quite smooth (except for the first time opening indexing is very time consuming).

 

    For Git and Docker container technologies, their relevance to Spring Boot is very high. Most of the applications are hosted on GitHub. Then, because most of the applications developed by Spring Boot are services and micro-service architectures, this architecture usually relies on With Docker to achieve rapid deployment and compose one-click deployment, it becomes very necessary to understand and learn them. As for the Docker deployment cluster management tools Mesos or Kubernetes, etc. to be learned later, in fact, it is also necessary to master. Here we recommend the coding (Code Market) website. There are many technical blogs on it to explain the experience and skills of actual developers.

 

    Considering such foreign resources, domestic downloads are sometimes slow, so it is recommended to modify the configuration to point to domestic resources. For example, the Maven library can be open sourced in China (the settings.xml file connecting resources such as aliyun and jboss can be downloaded from my upload resource), and also All images of docker are under DaoCloud. They also provide a Docker Hub accelerator tool, which can permanently modify the resource download address of the default docker image (http://get.daocloud.io), and DaoCloud updates the official website resources in real time, promising It is free forever, so there are so many advertisements, and it is recommended for personal use.

 

 

Spring Boot features

    

      1. Quickly build standalone Spring applications 

 

      2. Embedded Tomcat, Jetty container, no need to deploy WAR package 

      

      3. Simplify Maven and Gradle configuration 

 

      4. Automatically configure Spring as much as possible, no code generation and xml configuration 

 

      5. Practical functions directly embedded in the product environment, such as metrics, health checks, and extended configurations, etc. 

 

      6. Integrate mainstream development frameworks and toolchains without configuration

 

 

 

advantage

 

      1. Solve the problem of cumbersome configuration and maximize the realization of convention over configuration (convention is greater than configuration); 

      

      2. The problem to be solved by springboot is to simplify the configuration on the one hand, and on the other hand, it is very convenient to integrate the spring ecosystem with other tool chains (such as redis, email, elecsearch) 

 

      3. There are two godfathers, Pivotal and Netflix. I personally think that SpringBoot (provided by the Pivotal team) has a bright future (some major domestic manufacturers have actually used it for a long time)

 

 

 

shortcoming

 

      1. 因为刚出不久,文档略少,加上对Spring Boot的auto configuration loading等机制的封装, 给人感觉入门容易,但是如果没有完整学习spring的体系,碰到问题就一脸懵逼。据我所知,很多玩spring boot的人连怎么打开底层包的log都不知道,怎么可能能发现问题呢?比如很多人会碰到启动时不知道框架哪里抽风,会导致系统无法启动,报的错都很神奇,搜完百度和谷歌和stackflow都没解决方案。(后来有人说@DependsOn注解就能搞定,没试过不清楚行不行); 

      

      2. 版本迭代速度太快(最近太火了), 一些模块改动很大, 比如 springboot-test的1.3.5 vs 1.4

 

 

 

总结

 

    Spring boot给我的感觉是入门容易,深入难。它实现了我们之前常用的Spring技术,并通过零配置或者说约定大于配置的方式将其集成在一起,方便开发者快速开发应用,这种封装的方式有好有坏,当然操作变简单这是最真实的体验。Boot的诞生依靠的是近几年SOA式的微服务架构的流行,也正是这个原因,他多数应用在微服务中充当个体。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326492029&siteId=291194637