All Projects → 9527dong → Tiny Spring

9527dong / Tiny Spring

本项目是一个精简版的spring,通过自己实现一遍spring来理解spring框架的精华。

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Tiny Spring

Ssm
J2EE项目系列(四)–SSM框架构建积分系统和基本商品检索系统(Spring+SpringMVC+MyBatis+Lucene+Redis+MAVEN)
Stars: ✭ 914 (+6930.77%)
Mutual labels:  spring
Cogstack Pipeline
Distributed, fault tolerant batch processing for Natural Language Applications and Search, using remote partitioning
Stars: ✭ 26 (+100%)
Mutual labels:  spring
Openespi Datacustodian Java
Spring Framework implementation of a Green Button Data Custodian OpenESPI Application
Stars: ✭ 9 (-30.77%)
Mutual labels:  spring
Spring Postgresql Demo
Spring Boot 2.0 application, backed by PostgreSQL, and designed for deployment to Pivotal Cloud Foundry (PCF)
Stars: ✭ 23 (+76.92%)
Mutual labels:  spring
Twjitm
项目基于idea工作环境搭建的框架,添加mybatis3,spring4,springmvc4,以及redis。主要实现通过注解和反射自定义netty私有协议栈,实现在一条socket通道上传递不同的消息,采用支持tcp,udp和http协议
Stars: ✭ 26 (+100%)
Mutual labels:  spring
Bestnote
👊 持续更新,Java Android 近几年最全面的技术点以及面试题 供自己学习使用
Stars: ✭ 841 (+6369.23%)
Mutual labels:  spring
Spring Velocity Support
An support project of legacy velocity based on Spring Framework
Stars: ✭ 22 (+69.23%)
Mutual labels:  spring
Spring Cloud Examples
Examples of microservice instrastructures
Stars: ✭ 11 (-15.38%)
Mutual labels:  spring
Command Bus
Java implementation of the Command-Bus pattern for Spring and CDI
Stars: ✭ 26 (+100%)
Mutual labels:  spring
Chess
An online chessboard made with Spring, JSF 2 and Primefaces.
Stars: ✭ 8 (-38.46%)
Mutual labels:  spring
Javastudspringmvcweb
This is annotation based on Spring and Hibernate Version 4 project.
Stars: ✭ 24 (+84.62%)
Mutual labels:  spring
Servletjsptutorial
《Servlet & JSP 技術手冊 - 從 Servlet 到 Spring Boot》相關資源
Stars: ✭ 25 (+92.31%)
Mutual labels:  spring
Springbootunity
rabbitmq、redis、scheduled、socket、mongodb、Swagger2、spring data jpa、Thymeleaf、freemarker etc. (muti module spring boot project) (with spring boot framework,different bussiness scence with different technology。)
Stars: ✭ 845 (+6400%)
Mutual labels:  spring
Localstack Spring Boot
Spring Boot AutoConfiguration for LocalStack
Stars: ✭ 22 (+69.23%)
Mutual labels:  spring
Jsf2.2 Spring4 Hibernate4 Mysql
Full configured JSF2.2.10, Primefaces5, Spring4, Hibernate4/MySQL working project
Stars: ✭ 10 (-23.08%)
Mutual labels:  spring
Mart Holiday Alarm
🛒 마트쉬는날 🏖
Stars: ✭ 22 (+69.23%)
Mutual labels:  spring
Oauth Demo
Spring Security OAuth2 + MongoDB
Stars: ✭ 7 (-46.15%)
Mutual labels:  spring
Spring Reactive Sample
Spring 5 Reactive playground
Stars: ✭ 867 (+6569.23%)
Mutual labels:  spring
Goslings
Goslings - Git Repository Visualizer
Stars: ✭ 11 (-15.38%)
Mutual labels:  spring
Workflow Service Activiti
workflow service extensions built on Bpmn 2.0 & Activiti 5.13
Stars: ✭ 8 (-38.46%)
Mutual labels:  spring

tiny-spring

本项目是一个精简版的spring,通过自己实现一遍spring来理解spring框架的精华。

IOC计划

  • [x] 最基本的容器: 使用BeanFactory来获取bean,使用BeanDefinition来封装bean对象。
  • [x] 将bean创建放入工厂: 设置beanClass的名称,通过反射来创建bean。
  • [x] 为bean注入属性: 使用PropertyValue对象来存储bean的属性信息,使用ConstructorValue来存储构造器属性信息。
  • [x] 读取xml配置来初始化bean: 引用XMLBeanDefinitionReader来读取xml中的信息,并将xml中的信息转化为BeanDefinition和PropertyValue
  • [x] 实现ApplicationContext: 自动初始化所有bean

AOP计划

aop的实现遵守的aop联盟的规定,所以需要先引入aopalliance.jar

  • [x] 实现简单版的jdk和cglib的动态代理: jdk动态代理通过InvocationHandler实现,缺点是必须需要代理的类必须实现了接口才能被jdk代理;CGLIB是一个基于ASM的字节码生成库,它允许我们在运行时对字节码进行修改和动态生成,CGLIB通过继承方式实现代理。
  • [x] 通过ProxyFactoryBean来实现aop和ioc的结合。
    1. 实现BeanFactoryAware接口,将beanFactory注入到ProxyFactoryBean中
    2. 实现FactoryBean,获取代理对象
  • [x] 实现引入: 对类的功能增强,实现原来类未实现的接口
  • [ ] 实现切面功能: 即通知点和通知的结合
  • [ ] 实现aop自动代理,扫描 Bean 名称
  • [ ] 接入aspectj,实现注解式配置切面

收获

  1. 对java中的一些概念有了更深入的理解,比如java内省、javaBean 等。
  2. 阅读源码能力得到增强,现在读spring的源码,再也不会迷路了。
  3. 当自己写好一个功能后,再去看看spring是怎么实现的,会有种恍然大悟的感觉!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].