码迷,mamicode.com
首页 > 其他好文 > 详细

自己实现IOC过程

时间:2017-08-26 12:45:55      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:注入   type   code   blog   interface   time   imp   div   阅读   

阅读了《架构探险》这本书之后简单梳理一下自己实现IOC的基本流程

首先要自己定义一个注解

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 依赖注入注解
 *
 * @since 1.0.0
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Inject {
}

这个注解标记在类中的哪个属性

自己实现IOC过程

标签:注入   type   code   blog   interface   time   imp   div   阅读   

原文地址:http://www.cnblogs.com/blythe/p/7434915.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!