{"title":"基于属性文件按方面实现观察者模式","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":"{\"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}","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}
The implementation of Observer pattern by aspect based on properties file
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.