啃一啃 Spring 的官方文档

2020-01-09  

学 Spring,最好的资料无疑是它的官方文档了。

 

打开了 Spring 的官网:https://spring.io/

 

首页隆重介绍了

  • Spring Framework 5:重点解决异步无阻塞问题和 Spring WebFlux 新的响应式 Web 堆栈

  • Spring Boot:旨在通过最少的 Spring 前期配置尽快启动并运行

  • Spring Cloud:协调简化分布式系统

  • Spring Cloud Data Flow:连接任何数据,帮助轻松构建和编排云原生数据管道的用例

 

顶部菜单

  • PROJECTS 菜单页,列出了很多主要项目

  • GUIDES 菜单页,列出了很多功能模块的指导手册,如构建 RESTful Web 服务、任务调度...

  • BLOG 菜单页,Srping 的官方博客,产品新版本的发布与重大事件的记录

  • TRAINING & CERTIFICATION:培训与证书

     

网站 logo 的部分显示了 Spring By Pivotal,好奇查了下 Pivotal 这家公司。


2013 年 VMware 和 EMC 联合创建,获取 GE(通用电气) 1.05 亿美元投资
专注开源PaaS和大数据应用的 Cloud Foundry、Greenplum 等业务
提供的产品与服务就包含 Spring
它就是 Spring 幕后的 boss...

 

 

Spring 家族中,我使用最多的就是 Spring Framework、Spring Boot、Spring Cloud

 

Spring Framework

  • 是 Spring 家族中的所有产品的基础

  • 已经发展到 Version 5.2.3.BUILD-SNAPSHOT

  • JDK 要求最低 1.8

  • 对 Kotlin、Groovy 的支持也是很友好

  • 展示的设计哲学也是挺唬人:集成第三方;拥有灵活性;保持强大的向后兼容;注重 API 的设计;高标准代码质量

 

当前版本文档

https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/index.html

历史版本文档

https://docs.spring.io/spring-framework/docs/

 

Spring Framework 的所有功能说明都在这里了。


Overview:history, design philosophy, feedback, getting started.
Core:IoC Container, Events, Resources, i18n, Validation, Data Binding, Type Conversion, SpEL, AOP.
Testing:Mock Objects, TestContext Framework, Spring MVC Test, WebTestClient.
Data Access:Transactions, DAO Support, JDBC, O/R Mapping, XML Marshalling.
Web Servlet:Spring MVC, WebSocket, SockJS, STOMP Messaging.
Web Reactive:Spring WebFlux, WebClient, WebSocket.
Integration:Remoting, JMS, JCA, JMX, Email, Tasks, Scheduling, Caching.
Languages:Kotlin, Groovy, Dynamic Languages.

 

 

Spring Boot

亮点就是提供了一个初始化工具的页面,可以按需选择自己想要的 语言、Spring Boot版本、JDK 版本、项目类库依赖,下载一个整合好的 demo 压缩包。

https://start.spring.io/

 

当前版本文档

https://docs.spring.io/spring-boot/docs/current/reference/html/

历史版本文档

https://docs.spring.io/spring-boot/docs/
The reference documentation consists of the following sections:
Legal:Legal information.
Documentation Overview:About the Documentation, Getting Help, First Steps, and more.
Getting Started:Introducing Spring Boot, System Requirements, Servlet Containers, Installing Spring Boot, Developing Your First Spring Boot Application
Using Spring Boot:Build Systems, Structuring Your Code, Configuration, Spring Beans and Dependency Injection, and more.
Spring Boot Features:Profiles, Logging, Security, Caching, Spring Integration, Testing, and more.
Spring Boot Actuator:Monitoring, Metrics, Auditing, and more.
Deploying Spring Boot Applications:Deploying to the Cloud, Installing as a Unix application.
Spring Boot CLI:Installing the CLI, Using the CLI, Configuring the CLI, and more.
Build Tool Plugins:Maven Plugin, Gradle Plugin, Antlib, and more.
“How-to” Guides:Application Development, Configuration, Embedded Servers, Data Access, and many more.

The reference documentation has the following appendices:
Application Properties:Common application properties that can be used to configure your application.
Configuration Metadata:Metadata used to describe configuration properties.
Auto-configuration Classes:Auto-configuration classes provided by Spring Boot.
Test Auto-configuration Annotations:Test-autoconfiguration annotations used to test slices of your application.
Executable Jars:Spring Boot’s executable jars, their launchers, and their format.
Dependency Versions:Details of the dependencies that are managed by Spring Boot.


译文:
参考文档包括以下部分:
法律:法律信息
文档概述:关于文档,获得帮助,第一步等
入门:介绍Spring Boot,系统要求,Servlet容器,安装Spring Boot,开发第一个Spring Boot应用程序
使用Spring Boot:构建系统,结构化代码,配置,Spring Bean和依赖注入等
Spring Boot功能:配置文件,日志记录,安全性,缓存,Spring集成,测试等
Spring Boot驱动器:监控,指标,审核等
部署Spring Boot应用程序:部署到云,作为Unix应用程序安装
Spring Boot CLI:安装CLI,使用CLI,配置CLI等
生成工具插件:Maven插件,Gradle插件,Antlib等
“使用方法”指南:应用程序开发,配置,嵌入式服务器,数据访问等等

参考文档具有以下附录:
应用属性:可用于配置应用程序的通用应用程序属性
配置元数据:用于描述配置属性的元数据
自动配置类:Spring Boot提供的自动配置类
测试自动配置注释:用于测试应用程序切片的测试自动配置批注
可执行Jars:Spring Boot的可执行jar,其启动器及其格式
依赖版本:Spring Boot管理的依赖项的详细信息

 

 

Spring Cloud

为开发人员提供了工具,以快速构建分布式系统中的某些常见模式(例如,配置管理,服务发现,断路器,智能路由,微代理,控制总线,一次性令牌,全局锁,领导选举,分布式会话,群集状态)

项目介绍与主要工具列表

https://spring.io/projects/spring-cloud

对于 Spring Cloud 相关的集成,也可以在初始化工具的页面勾选

https://start.spring.io/

 

 


 

百度、google 查了那么多年 N 手文档,是时候提升下逼格,玩玩一手货!

 

英文文档的阅读是技术进阶的必经之路...

 

ConstXiong 备案号:苏ICP备16009629号-3