Spring启动教程

Welcome to Spring Boot Tutorial. Spring Boot is a completely new project from Pivotal Team(The Spring Team). It is a Framework developed on top of existing Spring Framework.

欢迎使用Spring Boot教程。 Spring Boot是Pivotal团队(The Spring Team)的一个全新项目。 它是在现有Spring Framework之上开发的Framework。

Spring启动教程 (Spring Boot Tutorial)

Spring Boot uses completely new development model to make Java Development very easy by avoiding some tedious development steps and boilerplate code and configuration.

Spring Boot使用全新的开发模型,从而避免了一些繁琐的开发步骤以及样板代码和配置,从而使Java开发变得非常容易。

什么是Spring Boot? (What is Spring Boot?)

Spring Boot is a Framework from “The Spring Team” to ease the bootstrapping and development of new Spring Applications.
It provides defaults for code and annotation configuration to quick start new Spring projects within no time. It follows “Opinionated Defaults Configuration” Approach to avoid lot of boilerplate code and configuration to improve Development, Unit Test and Integration Test Process.

Spring Boot是“ The Spring Team”的框架,用于简化新Spring应用程序的引导和开发。
它提供了代码和注释配置的默认值,可以在短时间内快速启动新的Spring项目。 它遵循“有意识的默认配置”方法,从而避免了很多样板代码和配置,从而改善了开发,单元测试和集成测试过程。

什么不是Spring Boot? (What is NOT Spring Boot?)

Spring Boot Framework is not implemented from the scratch by The Spring Team, rather than implemented on top of existing Spring Framework (Spring IO Platform).
It is not used for solving any new problems. It is used to solve same problems like Spring Framework.

Spring Boot Framework不是由Spring团队从头开始实现的,而是在现有Spring Framework(Spring IO平台)之上实现的。
它不用于解决任何新问题。 它用于解决类似Spring Framework的问题。

为什么选择Spring Boot? (Why Spring Boot?)

  • To ease the Java-based applications Development, Unit Test and Integration Test Process.

    为了简化基于Java的应用程序的开发,单元测试和集成测试过程。
  • To reduce Development, Unit Test and Integration Test time by providing some defaults.

    为了减少开发,单元测试和集成测试的时间,请提供一些默认设置。
  • To increase Productivity.

    为了提高生产率。

Don’t worry about what is “Opinionated Defaults Configuration” Approach at this stage. We will explain this in detail with some examples in coming posts.

在此阶段,不必担心什么是“默认默认配置”方法。 我们将在以后的文章中用一些示例详细解释这一点。

Spring Boot的优点: (Advantages of Spring Boot:)

  • It is very easy to develop Spring Based applications with Java or Groovy.

    使用Java或Groovy开发基于Spring的应用程序非常容易。
  • It reduces lots of development time and increases productivity.

    它减少了很多开发时间并提高了生产率。
  • It avoids writing lots of boilerplate Code, Annotations and XML Configuration.

    它避免了编写大量样板代码,注释和XML配置。
  • It is very easy to integrate Spring Boot Application with its Spring Ecosystem like Spring JDBC, Spring ORM, Spring Data, Spring Security etc.

    将Spring Boot应用程序与其Spring生态系统(例如Spring JDBC,Spring ORM,Spring Data,Spring Security等)集成在一起非常容易。
  • It follows “Opinionated Defaults Configuration” Approach to reduce Developer effort

    它遵循“有意识的默认配置”方法,以减少开发人员的工作量
  • It provides Embedded HTTP servers like Tomcat, Jetty etc. to develop and test our web applications very easily.

    它提供了Tomcat,Jetty等嵌入式HTTP服务器,可以非常轻松地开发和测试我们的Web应用程序。
  • It provides CLI (Command Line Interface) tool to develop and test Spring Boot(Java or Groovy) Applications from command prompt very easily and quickly.

    它提供了CLI(命令行界面)工具,可从命令提示符轻松快速地开发和测试Spring Boot(Java或Groovy)应用程序。
  • It provides lots of plugins to develop and test Spring Boot Applications very easily using Build Tools like Maven and Gradle

    它提供了许多插件,可使用Maven和Gradle等构建工具非常轻松地开发和测试Spring Boot应用程序
  • It provides lots of plugins to work with embedded and in-memory Databases very easily.

    它提供了许多插件,可以非常轻松地与嵌入式数据库和内存数据库一起使用。

In Simple Terminology, What Spring Boot means

在简单术语中,Spring Boot的含义

That means Spring Boot is nothing but existing Spring Framework + Some Embedded HTTP Servers (Tomcat/Jetty etc.) – XML or Annotations Configurations.
Here minus means we don’t need to write any XML Configuration and few Annotations only.

这意味着Spring Boot只不过是现有的Spring Framework +一些嵌入式HTTP服务器(Tomcat / Jetty等)– XML或注释配置。
这里的减号意味着我们不需要编写任何XML配置和少量注释。

Spring Boot的主要目标: (Main Goal of Spring Boot:)

The main goal of Spring Boot Framework is to reduce Development, Unit Test and Integration Test time and to ease the development of Production ready web applications very easily compared to existing Spring Framework, which really takes more time.

与现有的Spring Framework相比,Spring Boot Framework的主要目标是减少开发,单元测试和集成测试的时间,并非常容易地简化可用于生产环境的Web应用程序的开发,而这实际上要花费更多的时间。

  • To avoid XML Configuration completely

    完全避免XML配置
  • To avoid defining more Annotation Configuration(It combined some existing Spring Framework Annotations to a simple and single Annotation)

    为了避免定义更多的注释配置(它将一些现有的Spring Framework注释合并为一个简单的单一注释)
  • To avoid writing lots of import statements

    为避免编写大量导入语句
  • To provide some defaults to quick start new projects within no time.

    提供一些默认设置以快速启动新项目。
  • To provide Opinionated Development approach.

    提供有思想的发展方法。

By providing or avoiding these things, Spring Boot Framework reduces Development time, Developer Effort and increases productivity.

通过提供或避免这些事情,Spring Boot Framework减少了开发时间,开发人员的工作量并提高了生产率。

Spring Boot的限制/缺点: (Limitation/Drawback of Spring Boot:)

Spring Boot Framework has one limitation.
It is some what bit time consuming process to convert existing or legacy Spring Framework projects into Spring Boot Applications but we can convert all kinds of projects into Spring Boot Applications. It is very easy to create brand new/Greenfield Projects using Spring Boot.

Spring Boot Framework有一个限制。
将现有或旧版Spring Framework项目转换为Spring Boot应用程序需要一些时间,但是我们可以将各种项目转换为Spring Boot应用程序。 使用Spring Boot创建全新的/ Greenfield项目非常容易。

To Start Opinionated Approach to create Spring Boot Applications, The Spring Team (The Pivotal Team) has provided the following three approaches.

为了开始使用有思想的方法来创建Spring Boot应用程序,Spring团队(Pivotal团队)提供了以下三种方法。

  • Using Spring Boot CLI Tool

    使用Spring Boot CLI工具
  • Using Spring STS IDE

    使用Spring STS IDE
  • Using Spring Initializr Website

    使用Spring Initializr网站

We will discuss one by one in detail with some good examples in coming posts. We can find Spring Initializr Website at: https://start.spring.io/
We can develop two flavors of Spring-Based Applications using Spring Boot

我们将在以后的文章中逐一详细讨论,并提供一些很好的例子。 我们可以在以下位置找到Spring Initializr网站:https://start.spring.io/
我们可以使用Spring Boot开发两种基于Spring的应用程序

  • Java-Based Applications

    基于Java的应用程序
  • Groovy Applications

    Groovy应用

We can use Spring Boot CLI or Spring STS IDE or Spring Initializr Website to develop Spring Boot Groovy Applications. However, we can use Spring STS IDE or Spring Initializr Website to develop Spring Boot Java Applications.

我们可以使用Spring Boot CLI或Spring STS IDE或Spring Initializr网站开发Spring Boot Groovy应用程序。 但是,我们可以使用Spring STS IDE或Spring Initializr网站开发Spring Boot Java应用程序。

Anyhow, Groovy is also JVM language almost similar to Java Language. We can combine both Groovy and Java into one Project. Because like Java files, Groovy files are finally compiled into *.class files only. Both *.groovy and *.java files are converted to *.class file (Same byte code format).

无论如何,Groovy还是与Java语言几乎相似的JVM语言。 我们可以将Groovy和Java组合到一个项目中。 因为与Java文件一样,Groovy文件最终仅被编译为* .class文件。 * .groovy和* .java文件都将转换为* .class文件(相同的字节码格式)。

java groovy compiler, spring boot

Spring Boot Framework Programming model is inspired by Groovy Programming model. Spring Boot internally uses some Groovy based techniques and tools to provide default imports and configuration.


Spring Boot Framework编程模型的灵感来自Groovy编程模型。 Spring Boot内部使用一些基于Groovy的技术和工具来提供默认的导入和配置。

Spring Boot Framework also combined existing Spring Framework annotations into some simple or single annotations. We will explore those annotations one by one in coming posts with some real-time examples.

Spring Boot Framework还将现有的Spring Framework注释合并为一些简单或单个注释。 我们将在后续文章中逐一探讨这些注释,并提供一些实时示例。

Spring Boot Framework drastically changes Spring-Java Based Applications Programming model into new Programming model. As of now, Spring Boot is at initial stage only but future is all about Spring Boot only.

Spring Boot Framework将基于Spring-Java的应用程序编程模型彻底改变为新的编程模型。 到目前为止,Spring Boot仅处于初始阶段,而未来仅与Spring Boot有关。

Happy Spring Boot Framework Learning!

Spring快乐启动框架学习!

翻译自: https://www.journaldev.com/7969/spring-boot-tutorial

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值