GithubHelp home page GithubHelp logo

n040661 / minispring Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 30 KB

阅读Spring源码的过程中遇到了巨大的困难,繁杂的设计对读者的阅读流畅和理解极不友好,所以尝试着将其中核心的部分抽离出来,集成一个小型的Spring框架

Java 100.00%

minispring's Introduction

miniSpring

阅读Spring源码的过程中遇到了巨大的困难,过于繁杂的设计对初学者的阅读流畅和理解极不友好,所以尝试着将其中核心的部分抽离出来,集成一个小型的Spring框架

IOC执行总结:

1、初始化IOC容器

2、读取配置文件

3、将配置文件转换为容器识别的数据结构,即BeanDefinition

4、利用BeanDefinition并结合java的反射机制实例化相应的对象

5、注入对象之间的依赖关系

AOP执行总结:

1、初始化 Aop 容器。

2、读取配置文件。

3、将配置文件装换为 Aop 能够识别的数据结构 – Advisor。这里展开讲一讲这个advisor。Advisor对象中包又含了两个重要的数据结构,一个是 Advice,一个是 Pointcut。Advice的作用就是描述一个切面的行为,pointcut描述的是切面的位置。两个数据结的组合就是”在哪里,干什么“。这样 Advisor 就�包含了”在哪里干什么“的信息,就能够全面的描述切面了。

4、Spring 将这个 Advisor 转换成自己能够识别的数据结构 – AdvicedSupport。Spirng 动态的将这些方法拦截器织入到对应的方法。

5、生成动态代理代理。

6、提供调用,在使用的时候,调用方调用的就是代理方法。也就是已经织入了增强方法的方法。

minispring's People

Contributors

howie1995 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

kaccngit

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.