The implementation of Observer pattern by aspect based on properties file

L. Jicheng, W. Yuhua, W. Yabo, Xu Su
{"title":"The implementation of Observer pattern by aspect based on properties file","authors":"L. Jicheng, W. Yuhua, W. Yabo, Xu Su","doi":"10.1109/ICCSE.2009.5228245","DOIUrl":null,"url":null,"abstract":"In the implementation of Observer pattern by OOP, the subject objects and the observer objects must implement one interface or extend one abstract class to indicate their roles. When it is implemented by AOP, there is not such requirement. The participants and their relations are defined in an aspect, it isn't necessary for these participants to implement one interface or extending one abstract class. But users need to know aspect language to use this method. This paper provides a novel method to implement this pattern, participant objects and their relations are defined in a properties file, which is often used in Java programming. On the basis of analyzing Observer pattern implemented by AOP, the paper discussed how to use some simple grammars to define participant classes and their relations, how to establish the association between the subject and the observer is discussed in details. After analyzing the properties file, the aspect is generated, compiling and weaving this aspect with the target classes is done. So users may use Aspect implementation by properties file.","PeriodicalId":303484,"journal":{"name":"2009 4th International Conference on Computer Science & Education","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-07-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2009 4th International Conference on Computer Science & Education","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICCSE.2009.5228245","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

In the implementation of Observer pattern by OOP, the subject objects and the observer objects must implement one interface or extend one abstract class to indicate their roles. When it is implemented by AOP, there is not such requirement. The participants and their relations are defined in an aspect, it isn't necessary for these participants to implement one interface or extending one abstract class. But users need to know aspect language to use this method. This paper provides a novel method to implement this pattern, participant objects and their relations are defined in a properties file, which is often used in Java programming. On the basis of analyzing Observer pattern implemented by AOP, the paper discussed how to use some simple grammars to define participant classes and their relations, how to establish the association between the subject and the observer is discussed in details. After analyzing the properties file, the aspect is generated, compiling and weaving this aspect with the target classes is done. So users may use Aspect implementation by properties file.
基于属性文件按方面实现观察者模式
在用OOP实现观察者模式时,主体对象和观察者对象必须实现一个接口或扩展一个抽象类来表示它们的角色。当它被AOP实现时,就没有这样的需求了。参与者及其关系在一个方面中定义,这些参与者没有必要实现一个接口或扩展一个抽象类。但是用户需要了解方面语言才能使用这种方法。本文提供了一种新的方法来实现这种模式,在Java编程中经常使用的属性文件中定义参与者对象及其关系。在分析AOP实现的观察者模式的基础上,讨论了如何使用一些简单的语法来定义参与者类及其关系,并详细讨论了如何建立主体与观察者之间的关联。在分析属性文件之后,将生成方面,并将此方面与目标类进行编译和编织。因此用户可以通过属性文件使用Aspect实现。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信