spirng framework源码解析之前序工作(一)

293 阅读2分钟

这是我参与8月更文挑战的第一天,活动详情查看:8月更文挑战

前言

如今spring对于java后端来说已经成为也其行业的标准,那么为什么要进行源码的解析呢?原因很简单就是学以致用,大到设计思想小到命名规范,其实都是值得我们去参考学习的,主要是学习它思想。

规约

这里笔者采用的版本为当前最新的稳定版本5.3.9,java版本为1.8,开发工具为idea。

准备工作

官网介绍

ok,要想进行源码解析,首先我们得知道spring是用来干什么的,直接百度spring,然后进入其官网,点击why spring后,以下就是官方的介绍: image.png

大概意思是:使Java编程对每个人来说更快、更容易、更安全。Spring对速度、简单性和生产率的关注使它成为世界上最流行的Java框架。

接着官网的下面卡片spring is flexible中有这样一段描述信息:

image.png

Spring’s flexible and comprehensive set of extensions and third-party libraries let developers build almost any application imaginable. At its core, Spring Framework’s Inversion of Control (IoC) and Dependency Injection (DI) features provide the foundation for a wide-ranging set of features and functionality. Whether you’re building secure, reactive, cloud-based microservices for the web, or complex streaming data flows for the enterprise, Spring has the tools to help

大概意思是: spring可以灵活的进行扩展,可以构建几乎所有的应用,其核心的是Spring Framework项目中的IOCDI。笔者本次专题也是围绕的spring核心的模块进行解析。

源代码

spring的代码是放在github上的,进入spring主页后就可以看到Spring Framework项目了,将其克隆到本地,利用开发工具方便阅读。由于spring使用的gradle进行包的管理,所以要先下载gradle,若是采用的idea可以直接跳过,因为idea会自动帮你下载,不知道是笔者的网络原因,还是因为国外的地址导致的,真心很慢。。。

输出

每一次的源码解析后都应该有相应的输出,如文档,code等。