ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

SpringBoot架构浅谈

2019-06-15 18:38:39  阅读:237  来源: 互联网

标签:架构 浅谈 spring boot Spring data starter SpringBoot


首先来说一下什么是spring boot架构

Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。用我的话来理解,就是spring boot其实不是什么新的框架,它默认配置了很多框架的使用方式,就像maven整合了所有的jar包,spring boot整合Web项目所需要的框架。
那么spring boot有能够解决什么问题呢?

1) Spring Boot使编码变简单

     2) Spring Boot使配置变简单

     3) Spring Boot使部署变简单

     4) Spring Boot使监控变简单

     5) Spring Boot的不足

下面说一下Spring Boo的在平台中的定位,以及如何与相关的技术想融合

     1) SpringBoot与SEDA +MicroService + RESTful

     2) SpringBoot与Mock

然后再来看一看采用了这个 SpringBoot之后,技术的管理应该如何做

SpringBoot是伴随着Spring4.0诞生的;

从字面理解,Boot是引导的意思,因此SpringBoot帮助开发者快速搭建Spring框架;

SpringBoot帮助开发者快速启动一个Web容器;

SpringBoot继承了原有Spring框架的优秀基因;

SpringBoot简化了使用Spring的过程

那么应该如何使用SpringBoot到实践当中呢?

首先来说一说starter *的pom依赖

使用SpringBoot开发时,在pom.xml文件中引入的依赖一般都是形如spring-boot-starter-*。starter依赖是居于某个场景或者功能的,我们引入一个starter依赖之后,它会间接引入实现这个场景或功能所需的其他依赖。我们可以把这些starters称为场景启动器,只需要在项目里面引入这些starter相关场景的所有依赖都会导入进来。要用什么功能就导入什么场景的启动器。这里以spring-boot-starter-web为例分析。

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId></dependency>

 

 

spring-boot-starter-web的间接依赖


我们来看下spring-boot-starter-web的pom文件,它定义了一个父类spring-boot-starters

 

复制代码
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starters</artifactId>
        <version>1.5.4.RELEASE</version>
    </parent>
    <artifactId>spring-boot-starter-web</artifactId>
    <name>Spring Boot Web Starter</name>
    <url>http://projects.spring.io/spring-boot/</url>
    <organization>
        <name>Pivotal Software, Inc.</name>
        <url>http://www.spring.io</url>
    </organization>
    <properties>
        <main.basedir>${basedir}/../..</main.basedir>
    </properties>
复制代码

 

spring-boot-starters的打包类型为pom,它定义好了SpringBoot中所有的starter,同时它的父类为spring-boot-parent

复制代码
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-parent</artifactId>
        <version>1.5.4.RELEASE</version>
        <relativePath>../spring-boot-parent</relativePath>
    </parent>
    <artifactId>spring-boot-starters</artifactId>
    <packaging>pom</packaging>
    <name>Spring Boot Starters</name>
    <description>Spring Boot Starters</description>
    <url>http://projects.spring.io/spring-boot/</url>
    <organization>
        <name>Pivotal Software, Inc.</name>
        <url>http://www.spring.io</url>
    </organization>
    <properties>
        <main.basedir>${basedir}/..</main.basedir>
    </properties>
    <modules>
        <module>spring-boot-starter</module>
        <module>spring-boot-starter-activemq</module>
        <module>spring-boot-starter-amqp</module>
        <module>spring-boot-starter-aop</module>
        <module>spring-boot-starter-artemis</module>
        <module>spring-boot-starter-batch</module>
        <module>spring-boot-starter-cache</module>
        <module>spring-boot-starter-cloud-connectors</module>
        <module>spring-boot-starter-data-cassandra</module>
        <module>spring-boot-starter-data-couchbase</module>
        <module>spring-boot-starter-data-elasticsearch</module>
        <module>spring-boot-starter-data-gemfire</module>
        <module>spring-boot-starter-data-jpa</module>
        <module>spring-boot-starter-data-ldap</module>
        <module>spring-boot-starter-data-mongodb</module>
        <module>spring-boot-starter-data-neo4j</module>
        <module>spring-boot-starter-data-redis</module>
        <module>spring-boot-starter-data-rest</module>
        <module>spring-boot-starter-data-solr</module>
        <module>spring-boot-starter-freemarker</module>
        <module>spring-boot-starter-groovy-templates</module>
        <module>spring-boot-starter-hateoas</module>
        <module>spring-boot-starter-integration</module>
        <module>spring-boot-starter-jdbc</module>
        <module>spring-boot-starter-jersey</module>
        <module>spring-boot-starter-jetty</module>
        <module>spring-boot-starter-jooq</module>
        <module>spring-boot-starter-jta-atomikos</module>
        <module>spring-boot-starter-jta-bitronix</module>
        <module>spring-boot-starter-jta-narayana</module>
        <module>spring-boot-starter-logging</module>
        <module>spring-boot-starter-log4j2</module>
        <module>spring-boot-starter-mail</module>
        <module>spring-boot-starter-mobile</module>
        <module>spring-boot-starter-mustache</module>
        <module>spring-boot-starter-actuator</module>
        <module>spring-boot-starter-parent</module>
        <module>spring-boot-starter-security</module>
        <module>spring-boot-starter-social-facebook</module>
        <module>spring-boot-starter-social-twitter</module>
        <module>spring-boot-starter-social-linkedin</module>
        <module>spring-boot-starter-remote-shell</module>
        <module>spring-boot-starter-test</module>
        <module>spring-boot-starter-thymeleaf</module>
        <module>spring-boot-starter-tomcat</module>
        <module>spring-boot-starter-undertow</module>
        <module>spring-boot-starter-validation</module>
        <module>spring-boot-starter-web</module>
        <module>spring-boot-starter-websocket</module>
        <module>spring-boot-starter-web-services</module>
    </modules>
 
复制代码

引用:www.imooc.com/article/274147?block_id=tuijian_wz

https://www.cnblogs.com/anywherego/p/9591252.html

标签:架构,浅谈,spring,boot,Spring,data,starter,SpringBoot
来源: https://www.cnblogs.com/zhangliqiangvictory/p/11028459.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有