Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

mini-spring

> 后端框架
Open source

mini-spring is a simplified version of the Spring framework that helps you quickly familiarize yourself with Spring source code and master Spring's core princip

6.4K stars0 likes0 views
WebsiteGitHub

About

mini-spring is a simplified version of the Spring framework that helps you quickly familiarize yourself with Spring source code and master Spring's core princip

mini-spring

English | 简体中文

姊妹版:

  • mini-spring-cloud (简化版的spring cloud框架)
  • mini-netty (简化版的netty框架)
  • mini-claude-code (简化版的Claude Code)

关于

mini-spring是简化版的spring框架,能帮助你快速熟悉spring源码和掌握spring的核心原理。抽取了spring的核心逻辑,代码极度简化,保留spring的核心功能,如IoC和AOP、资源加载器、事件监听器、类型转换、容器扩展点、bean生命周期和作用域、应用上下文等核心功能。

如果本项目能帮助到你,请给个STAR,谢谢!!!

功能

基础篇

  • IoC
    • 实现一个简单的容器
    • BeanDefinition和BeanDefinitionRegistry
    • Bean实例化策略InstantiationStrategy
    • 为bean填充属性
    • 为bean注入bean
    • 资源和资源加载器
    • 在xml文件中定义bean
    • 容器扩展机制BeanFactoryPostProcess和BeanPostProcessor
    • 应用上下文ApplicationContext
    • bean的初始化和销毁方法
    • Aware接口
    • bean作用域,增加prototype的支持
    • FactoryBean
    • 容器事件和事件监听器
  • AOP
    • 切点表达式
    • 基于JDK的动态代理
    • 基于CGLIB的动态代理
    • AOP代理工厂ProxyFactory
    • 几种常用的Advice: BeforeAdvice/AfterAdvice/AfterReturningAdvice/ThrowsAdvice
    • PointcutAdvisor:Pointcut和Advice的组合
    • 动态代理融入bean生命周期

扩展篇

  • PropertyPlaceholderConfigurer
  • 包扫描
  • @Value注解
  • 基于注解@Autowired的依赖注入
  • 类型转换(一)
  • 类型转换(二)

高级篇

  • 解决循环依赖问题(一):没有代理对象
  • 解决循环依赖问题(二):有代理对象

其他

  • 没有为代理bean设置属性(discovered and fixed by kerwin89)
  • 支持懒加载和多切面增强(by zqczgl)

使用方法

阅读changelog.md

视频教程(完整版)

提问

点此提问

贡献

欢迎Pull Request

关于我

点此了解

Star History

版权说明

未取得本人书面许可,不得将该项目用于商业用途

参考

  • 《Spring源码深度解析》
  • 《Spring 源码解析》
  • 《精通Spring 4.x》
  • 《tiny-spring》

Issues· 32 open

View all issuesOpen on GitHub
  • #65

    有无静态页面方便阅读

    Updated Jun 3, 2026
  • #63

    初始化与销毁方法中,只避免销毁方法执行两次而初始化方法没有相关的判断

    Updated Jun 3, 2026
  • #69

    属性占位符替换时,如果当前bean存在String类型的属性但是不用占位符替换,会重复添加PropertyValue

    Updated Jun 3, 2026
  • #95

    只配置了init-destroy属性的代理对象无法找到销毁方法

    Updated Jun 3, 2026
  • #74

    Typora打开changelog可以看到类关系图片

    Updated Jun 3, 2026
  • #73

    FactoryBean有个功能没实现

    Updated Jun 3, 2026
  • #80

    changelog.md

    Updated Jun 3, 2026
  • #77

    提前实例化所有单例bean

    Updated Jun 3, 2026
  • #72

    跟着Git提交走,仿佛我成了当时的作者

    Updated Jun 3, 2026
  • #82

    受益匪浅,感谢大佬。什么时候可以加上事务的实现就完美了

    Updated Jun 3, 2026

> Tags

Javamini-springspringspring-bootspring-mvc

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架