{"title":"使用角色删除代码重复","authors":"Fernando Sérgio Barbosa, Ademar Aguiar","doi":"10.1109/SoMeT.2013.6645656","DOIUrl":null,"url":null,"abstract":"The existence of replicated code in a system makes that system harder to maintain and evolve. To remove replicated code the usual way is to use refactorings. However there are always clones that cannot be removed by refactorings alone. Some are due to lack of composition mechanisms in the underlying programming language. We propose the use of roles to remove such clones since roles provide a finer degree of composition. We sketch four role refactorings to remove code clones and apply them in a case study using the JHotDraw framework. Results show that roles have a positive impact in clone reduction as they were able to remove almost all clones traditional refactorings could not.","PeriodicalId":447065,"journal":{"name":"2013 IEEE 12th International Conference on Intelligent Software Methodologies, Tools and Techniques (SoMeT)","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2013-10-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":"{\"title\":\"Removing Code Duplication with Roles\",\"authors\":\"Fernando Sérgio Barbosa, Ademar Aguiar\",\"doi\":\"10.1109/SoMeT.2013.6645656\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The existence of replicated code in a system makes that system harder to maintain and evolve. To remove replicated code the usual way is to use refactorings. However there are always clones that cannot be removed by refactorings alone. Some are due to lack of composition mechanisms in the underlying programming language. We propose the use of roles to remove such clones since roles provide a finer degree of composition. We sketch four role refactorings to remove code clones and apply them in a case study using the JHotDraw framework. Results show that roles have a positive impact in clone reduction as they were able to remove almost all clones traditional refactorings could not.\",\"PeriodicalId\":447065,\"journal\":{\"name\":\"2013 IEEE 12th International Conference on Intelligent Software Methodologies, Tools and Techniques (SoMeT)\",\"volume\":\"30 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2013-10-24\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"4\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2013 IEEE 12th International Conference on Intelligent Software Methodologies, Tools and Techniques (SoMeT)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/SoMeT.2013.6645656\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2013 IEEE 12th International Conference on Intelligent Software Methodologies, Tools and Techniques (SoMeT)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SoMeT.2013.6645656","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
The existence of replicated code in a system makes that system harder to maintain and evolve. To remove replicated code the usual way is to use refactorings. However there are always clones that cannot be removed by refactorings alone. Some are due to lack of composition mechanisms in the underlying programming language. We propose the use of roles to remove such clones since roles provide a finer degree of composition. We sketch four role refactorings to remove code clones and apply them in a case study using the JHotDraw framework. Results show that roles have a positive impact in clone reduction as they were able to remove almost all clones traditional refactorings could not.