• spring基础


    1、spring两个最基本概念:依赖注入DI、面向切面AOP

    2、spring通过上下文Application Context装配bean,实现方式的区别是如何加载它们的配置信息, ClassPathXmlApplicationContext、FileSystemXmlApplicationContext、XmlWebApplicationContext

    3、面向切面编程往往被定义成促使应用程序分离关注点的一项技术,除了自身核心的功能之外,那些通常横向关注点的服务,如日志、事物管理、安全等

    4、Spring容器有两种:bean工厂、application应用上下文

    5、Spring模块

     

    6、Spring核心框架支持的命名空间:aop、beans、context、jee、jms、lang、mvc、oxm、tx、util

    7、Spring的bean的作用域:singleton、prototype、request、session、gloable-session

    8、为满足初始化和销毁bean的需求,spring提供了bean生命周期的钩子方法:init-method、destroy-method(另一种实现方式是实现InitializingBean/DisposableBean)

    9、Spring支持装配复合类型:list、set、map、props

    10、spring支持装配空值,覆盖自动装配的值或满足特殊需求

    11、spring支持使用表达式实现动态装配,null-safe存取器?. .?[]  .^[]  .$[]  .![]

    12、自动装配:byName,byType,constructor,autodetect    autowire/primary/autowire-candidate,默认自动装配范围default-autowire只是当前配置文件中的所有bean

    13、自动装配注解@Autowired @Qualifier(“”) 按类型装配,qualifier做限定,自定义限定器注解,@Inject/@Named

    14、自动检测@Component/@Controller/@Repository/@Service

    15、过滤组件扫描:include-filter/exclude-filter,扫描策略annotation、assignable、aspect、custom、regex

    16、srping基于java的配置注入:@Configuration

    17、通知Advice定义了切面是什么以及何时使用。切面的工作被称为通知,切面通知类型:Before/After/After-returning/After-throwing/Around

    18、连接点Joinpoint,应用可能需要对时机应用通知,这些时机被称为连接点,这个时机可以是调用方法时,抛出异常时,甚至修改一个字段时

    19、切点Pointcut定义了在何处使用切面,通常使用明确的类和方法名称来指定这些切点,切点定义了那些连接点会得到通知

    20、切面Aspect是切点和通知的结合。通知和切点共同定义了关于切面的全部内容

    21、织入weaving:编译期(AspectJ)/类加载期(AspectJ 5)/运行期,代理对象

    22、spring的AOP支持:基于代理的AOP/@AspectJ注解驱动的切面/纯POJO切面/注入式Aspectj切面

    23、spring基于动态代理,只支持方法连接点,缺少对字段连接点的支持,也不支持构造器连接点

    24、spring AOP支持的AspectJ支持的切点指示器:art()、@args、execution()、this()、target()、@target、within()、@within()、@annotation、bean(),只有execution指示器是唯一的执行匹配,其他的指示器都是用于限制匹配的,限制匹配时可以使用and/or/not

    25、在xml中声明切面<aop:advisor>、<aop:after>、<aop:after-returning>、<aop:after-throwing>、<aop:around>、<aop:aspect>、<aop:aspect-autoproxy>、<aop:before>、<aop:config>、<aop:declare-parents>、<aop:pointcut>

    26、通过切面引入新功能,<aop:declare-parents>,implement-interface,default-impl,delegate-ref,default与delegate的区别是delegate是Spring bean,可以被注入,通知,或使用其他spring配置等

    27、spring注解切面需要:引入aop命名空间’http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd’、创建代理<aop:aspectj-autoproxy>、注解切面(@Aspect/@Pointcut/@Before/@After)

    28、@AspectJ注解并不了解Spring的bean,若要委托给bean,则只能使用xml配置

    29、spring不能使用<bean>声明来创建AspectJ实例-它已经在运行时由AspectJ创建了,spring通过aspectOf()工厂方法获得切面的引用,然后像常规<bean>元素那样执行依赖注入

    30、a

  • 相关阅读:
    网络设备安全需求规格
    web安全法则
    Write Hole 问题
    如何同步master的代码到fork分支代码
    Self assignment
    Uninitialized scalar variable
    Operands of different size in bitwise operation
    Insecure Compiler Optimization
    negative array index read
    Unintended sign extension
  • 原文地址:https://www.cnblogs.com/ikuman/p/3596645.html
Copyright © 2020-2023  润新知