• 在前几天,我简单地介绍了AspectJ的一些高级特性,其中就有两种高级特性(Aspect precedence和Exception softening)将会用到declare关键字。declare关键字是AspectJ为了便于开发而提供的一种内部声明方式,既然,declare在AspectJ中比较常用,那我们就来看看declare的四种主要用法: 1、declare warning、declare error 当编译器在编译期间发现匹配pointcut的joi..............
  • 四、Exception softening 在Java中有两类异常:checked和unchecked exceptions。一般checked exceptions是需要我们捕获,或者重新抛出,而unchecked exceptions主要包括RuntimeException和Error,是不需要捕获的。 所谓的Exception softening就是可以把checked exceptions软化成unchecked exceptions。Exception softening的语法如下: declare soft : <ExceptionTypePattern&..............
  • 三、Aspect association 在Java中,为了节省对象每次构建的耗费,增加效率,很多人会考虑使用Singleton模式,让jvm中只有一个实例存在。AspectJ当然为我们考虑到这个问题,Aspect association实际上就是aspect与advised join point object的一种关联关系,这很类似于OO中association,譬如1:1,1:m等。Aspect association能让我们能更好地控制aspect的状态信息。 在AspectJ中可以把Aspect ass..............
  • 随着AOP越来越热门,PointCut、Advice和Introduce等这些AspectJ中的基本概念已经广为人知。但是,要在企业领域实际运用AspectJ,除了这些基础语法,还需要了解AspectJ的高级特性。 一、The reflection API 说到高级特性,首先要说的就是AspectJ提供的一套reflection API,主要包括JoinPoint、JoinPoint.StaticPart和Signature三个主要的接口。你可以从aspectj.jar中的javado..............
  • 2004-05-18

    AOP and annotations

    我发现是否在代码级加入annotations,讨论得非常积极,可以引起我们强烈的关注.下面是几个有关的blog: AOP and annotations: just say no Are we heading for annotation overkill? Time for AOP to save the day? ..............
  • 2004-03-19

    Nanning

    刚开始我还以为这是中国人的作品呢?原来只是作者Jon Tirsen来中国广西南宁旅游,后来非常喜欢这个城市,就以"南宁"来命名了,真是让我们汗颜呀. Nanning(http://nanning.codehaus.org)是一个Java AOP framework,它是以dynamic proxies的interceptor方式来实现Aop的. 下面介绍一些它的概念: Proxies The main object in the Core of N..............
  • 2004-03-17

    Aop资源

    一、相关网站: 1、aosd.net [http://aosd.net/] The home of aspect-oriented software development   2、AspectJ [http://eclipse.org/aspectj/] Mature and powerful AOP implementation that uses extensions to the Java languag..............