首页> 外文会议>IEEE international conference on computer science and information technology;ICCSIT 2010 >A Novel Implementation of Observer Pattern by Aspect Based on Java Annotation
【24h】

A Novel Implementation of Observer Pattern by Aspect Based on Java Annotation

机译:基于Java注释的观察者模式的一种新实现。

获取原文

摘要

In the implementation of Observer pattern by OOP, the subject objects and the observer objects must implement an interface or extend an abstract class to indicate their roles. When the pattern is implemented by AOP, there is not such a requirement. The participants and their relations are defined in an aspect, it isn't necessary for these participants to implement an interface or extending an abstract class. But users are required to know an aspect language to use this method. This paper provides a novel method to implement this pattern; participant objects and their relations are defined by Java annotations. On the basis of analyzing Observer pattern implemented by AOP, the paper discusses bow to define annotations to annotate participant classes and define their relations, how to establish the association between the subject and the observer is discussed in details. After analyzing classes annotated, the aspect is generated, then compiling and weaving this aspect with the target classes is done. So users may use Aspect implementation by Java annotation.
机译:在通过OOP实现观察者模式时,主题对象和观察者对象必须实现接口或扩展抽象类以指示其作用。当通过AOP实现该模式时,就没有这种要求。参与者及其关系是在一个方面定义的,这些参与者无需实现接口或扩展抽象类。但是,用户必须了解一种方面的语言才能使用此方法。本文提供了一种实现该模式的新颖方法。参与者对象及其关系由Java注释定义。在分析AOP实现的观察者模式的基础上,讨论了弓形定义注解以注释参与者类并定义它们之间的关系,并详细讨论了如何建立主题与观察者之间的联系。在分析带注释的类之后,将生成方面,然后将其与目标类进行编译和编织。因此,用户可以通过Java注释使用Aspect实现。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号