- 博客(3)
- 收藏
- 关注
原创 Spring AOP面向切面编程
Aspect Oriented Programming with SpringAspect-oriented Programming (AOP) complements Object-oriented Programming (OOP) by providing another way of thinking about program structure. The key unit of modularity in OOP is the class, whereas in AOP the unit .
2022-01-21 13:49:07 234
原创 Spring动态代理InvocationHandler接口和Proxy代理协议生成类
一、什么是动态代理动态,顾名思义就是动态去给某个接口类去代理,它不需要像静态代理一样,每个接口都要实现一个代理,如果项目做大之后,静态代理类的数量和维护的工作将是不能想象的二、动态代理的实现方式动态代理是通过Java反射的方式来实现的,实现InvocationHandler接口并通过Proxy类来动态的生成代理类既然知道了需要实现接口InvocationHandler,我们可以先来看一下InvocationHandler源码InvocationHandler is the interf
2022-01-20 10:24:26 648
原创 Spring IOC容器自动装配@Resource和@Autowired之间的区别
1、导入包的不同@Resource是由JavaEE提供,需要jdk1.5以上的版本javax.annotation.Resource@Autowired是由Spring容器提供,Spring2.5以上版本开始支持org.springframework.beans.factory.annotation.Autowired2、自动装配的方式不同@Autowired是byType的方式自动注入,简单说就是根据属性的类型自动装配@Resource默认是按照byName的方式自动注入,
2022-01-19 10:47:18 246
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人