Code Monkey home page Code Monkey logo

ksssss-spring-framework's Introduction

ksssss-spring-framework

参照spring实现的web框架

ioc

(1) 初始化容器 (2) 扫描所有注解并注册到容器中 (3) 实例化容器对象

  1. 注入对象
  2. 声明对象被ioc容器管理
  3. 循环依赖
  4. 注入指定bean

aop

  1. @Aspect
  2. @Pointcut
  3. @Before
  4. @After
  5. @Order

异常处理

拦截器

配置文件

代码质量

NOTE:

Spring refresh()流程 0. 设置容器启动

  1. 进入refreshBeanFactory()方法
    1. 进入判断容器是否初始化,如果没初始化创建基本的DefaultListableBeanFactory容器
    2. 调用loadBeanDefinitions(DefaultListableBeanFactory beanFactory)(将配置文件解析成BeanDefinition对象,并注入到BeanFactory中)
    3. 创建BeanDefinitionReader,并调用loadBeanDefinitions(String... locations)(通过模板方法getResource来获取Resource集合)
    4. 调用BeanDefinitionReader的loadBeanDefinitions(Resource resource)(将Resource解析成文档对象,这些对象并没有按照Spring的Bean规则进行解析);
    5. 调用registerBeanDefinitions(Document doc,Resource resource),通过BeanDefinitionDocumentReader的BeanDefinitionParserDelegate 将文档对象解析成BeanDefinitionHolder,BeanDefinitionHolder包含BeanDefinition和Bean别名,Bean的名字等。 并通过注入到registerBeanDefinition(String name, BeanDefinition beanDefinition)注入到DefaultListableBeanFactory容器中

ksssss-spring-framework's People

Contributors

ksssssssss avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.