Ali P8 Architect Share: Springboot summary of the core functions of the advantages and disadvantages

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/u013322876/article/details/90745060

Ali P8 Architect Share: Springboot summary of the core functions of the advantages and disadvantages

IT technology sharing 2019-05-29 23:55:12

Ali P8 Architect Share: Springboot summary of the core functions of the advantages and disadvantages

 

SpringBoot core functionality

1, independent operation Spring project

Spring boot can be run as a separate jar package form, run a Spring Boot project only needs to be run by java -jar xx.jar.

2, embedded servlet container

Spring Boot can select the embedded Tomcat, jetty or Undertow, so we do not need to deploy the project package in the form of war.

3, a starter simplified configuration Maven

a spring provided to simplify the series of start pom Maven load-dependent, for example, when you use a spring-boot-starter-web, is automatically added to the dependencies shown in FIG. 5-1.

4, automatic assembly Spring

SpringBoot based on the classpath jar package, class, to automatically configure Bean class jar inside the package, this will greatly reduce the configuration we want to use. Of course, SpringBoot only consider most development scenarios, not all of the scenes, if in the actual development we need to configure Bean, and SpringBoot off there to provide support, you can customize the automatic configuration.

5, quasi-production application monitoring

SpringBoot http ssh telnet-based project run-time monitoring.

6, the production and the xml configuration codeless

SpringBoot not help and code generation to achieve, but achieved through conditions annotation, which is a new feature Spring4.x provided.

Ali P8 Architect Share: Springboot summary of the core functions of the advantages and disadvantages

 

SpringBoot advantages and disadvantages

advantage:

  • Quickly build project.
  • No configuration for mainstream development framework integration.
  • Project can be run independently, without external dependencies Servlet container.
  • - to provide run-time application monitoring.
  • Greatly improving the development, deployment efficiency.
  • Natural integration with the cloud.

Disadvantages:

  • If you do not agree with spring framework, perhaps this is the drawback.

 

SpringBoot properties

  • Create a separate Spring project
  • Built-in Tomcat and Jetty container
  • 提供一个starter POMs来简化Maven配置
  • 提供了一系列大型项目中常见的非功能性特性,如安全、指标,健康检测、外部配置等
  • 完全没有代码生成和xml配置文件

SpringBoot CLI

SpringBoot CLI 是SpringBoot提供的控制台命令工具。

SpringBoot maven 构建项目

spring-boot-starter-parent:是一个特殊Start,它用来提供相关的Maven依赖项,使用它之后,常用的包依赖可以省去version标签。

Ali P8 Architect Share: Springboot summary of the core functions of the advantages and disadvantages

 

SpringBoot几个常用的注解

(1)@RestController和@Controller指定一个类,作为控制器的注解 ,并说明其区别

(2)@RequestMapping方法级别的映射注解,这一个用过Spring MVC的小伙伴相信都很熟悉

(3)@EnableAutoConfiguration和@SpringBootApplication是类级别的注解,根据maven依赖的jar来自动猜测完成正确的spring的对应配置,只要引入了spring-boot-starter-web的依赖,默认会自动配置Spring MVC和tomcat容器

(4)@Configuration类级别的注解,一般这个注解,我们用来标识main方法所在的类,完成元数据bean的初始化。

(5)@ComponentScan类级别的注解,自动扫描加载所有的Spring组件包括Bean注入,一般用在main方法所在的类上

(6)@ImportResource类级别注解,当我们必须使用一个xml的配置时,使用@ImportResource和@Configuration来标识这个文件资源的类。

(7)@Autowired注解,一般结合@ComponentScan注解,来自动注入一个Service或Dao级别的Bean

(8)@Component类级别注解,用来标识一个组件,比如我自定了一个filter,则需要此注解标识之后,Spring Boot才会正确识别。

springboot is how to manage the affairs? @Transactional write notes directly on the line, on the way is a transaction method, class is class affairs.

end: If you think this article helpful to you, remember to praise point forward, your support is my updated power.

Guess you like

Origin blog.csdn.net/u013322876/article/details/90745060
Recommended