RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
浅谈Spring和SpringBoot区别

对于SpringSpringBoot到底有什么区别,我听到了很多答案,刚开始迈入学习SpringBoot的我当时也是一头雾水,随着经验的积累、我慢慢理解了这两个框架到底有什么区别,相信对于用了SpringBoot很久的同学来说,还不是很理解SpringBoot到底和Spring有什么区别,本篇文章为大家简单的介绍一下SpringSpringBoot区别。

一、看一下spring的3全部项目

spring 家族 有很多项目,springboot、spring framework、spring cloud等。

我们常用的也就是,springboot、springcloud、springsecurity、springdata。常说的 springmvc 只是spring framework 的特性之一。

二、springboot核心能力

1、内嵌 Servlet 容器,可以直接打成jar包,通过 java -jar xx.jar 运行项目。

2、提供 starter pom 系列,简化maven的依赖加载,减少依赖冲突的发生。

3、支持自动化配置,如下图。application.properties 文件在引入springboot和未引入springboot时,是不一样的。

实现的源码:springboot回去判断引入的jar包是否有 spring.factories 文件

@EnableAutoConfiguration
@Import({AutoConfigurationImportSelector.class})
protected List getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes) {
 List configurations = SpringFactoriesLoader.loadFactoryNames(this.getSpringFactoriesLoaderFactoryClass(), this.getBeanClassLoader());
 Assert.notEmpty(configurations, "No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.");
 return configurations;
}


网页题目:浅谈Spring和SpringBoot区别
地址分享:http://www.jxjierui.cn/article/cdjieph.html