可以使用代理模式对函数进行增强,动态(jdk proxy、cglib)或静态代理
spring采用aop(spring声明式事务、Hystrix等)或者factoryBean(mybatis等)实现对bean的增强