DocumentCode :
1955243
Title :
A novel implementation of observer pattern by aspect based on Java annotation
Author :
Jicheng, Liu ; Hui, Yin ; Yabo, Wang
Author_Institution :
Inst. of Inf. Sci. & Eng., HAUT, Zhengzhou, China
Volume :
1
fYear :
2010
fDate :
9-11 July 2010
Firstpage :
284
Lastpage :
288
Abstract :
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 how 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.
Keywords :
Java; aspect-oriented programming; observers; AOP; Java annotation; OOP; aspect oriented programming; object oriented programming; observer objects; observer pattern; subject objects; Animals; Observers; Weaving; Aspect; AspectJ; Observer Pattern; java annotation;
fLanguage :
English
Publisher :
ieee
Conference_Titel :
Computer Science and Information Technology (ICCSIT), 2010 3rd IEEE International Conference on
Conference_Location :
Chengdu
Print_ISBN :
978-1-4244-5537-9
Type :
conf
DOI :
10.1109/ICCSIT.2010.5564893
Filename :
5564893
Link To Document :
بازگشت