{"title":"使用O-A图封装动态内存访问","authors":"P. Tonella","doi":"10.1109/ICSM.1998.738524","DOIUrl":null,"url":null,"abstract":"Good software design is characterized by low coupling between modules and high cohesion inside each module. This is obtained by encapsulating the details about the internal structure of data and exporting only public functions with a clean interface. For programming languages such as C, which offer little support for encapsulation, code analysis tools may help in assessing and improving the access to data structures. In this paper a new representation of the accesses of functions to dynamic locations, called the O-A diagram, is proposed. By isolating meaningful groups of functions working on common dynamic data, such a diagram can be used to evaluate the encapsulation in a program and to drive possible interventions to improve it. Experimental results suggest that the aggregations identified by the O-A diagram are actually cohesive functions operating on a shared data structure. The results are useful in themselves, by providing the programmer with information about the organization of the accesses to dynamic memory. In addition the O-A diagram permits highlighting violations of encapsulation, so that proper restructuring actions can be performed.","PeriodicalId":271895,"journal":{"name":"Proceedings. International Conference on Software Maintenance (Cat. No. 98CB36272)","volume":"76 5 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1998-03-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"Using the O-A diagram to encapsulate dynamic memory access\",\"authors\":\"P. Tonella\",\"doi\":\"10.1109/ICSM.1998.738524\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Good software design is characterized by low coupling between modules and high cohesion inside each module. This is obtained by encapsulating the details about the internal structure of data and exporting only public functions with a clean interface. For programming languages such as C, which offer little support for encapsulation, code analysis tools may help in assessing and improving the access to data structures. In this paper a new representation of the accesses of functions to dynamic locations, called the O-A diagram, is proposed. By isolating meaningful groups of functions working on common dynamic data, such a diagram can be used to evaluate the encapsulation in a program and to drive possible interventions to improve it. Experimental results suggest that the aggregations identified by the O-A diagram are actually cohesive functions operating on a shared data structure. The results are useful in themselves, by providing the programmer with information about the organization of the accesses to dynamic memory. In addition the O-A diagram permits highlighting violations of encapsulation, so that proper restructuring actions can be performed.\",\"PeriodicalId\":271895,\"journal\":{\"name\":\"Proceedings. International Conference on Software Maintenance (Cat. No. 98CB36272)\",\"volume\":\"76 5 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1998-03-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings. International Conference on Software Maintenance (Cat. No. 98CB36272)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/ICSM.1998.738524\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings. International Conference on Software Maintenance (Cat. No. 98CB36272)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICSM.1998.738524","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Using the O-A diagram to encapsulate dynamic memory access
Good software design is characterized by low coupling between modules and high cohesion inside each module. This is obtained by encapsulating the details about the internal structure of data and exporting only public functions with a clean interface. For programming languages such as C, which offer little support for encapsulation, code analysis tools may help in assessing and improving the access to data structures. In this paper a new representation of the accesses of functions to dynamic locations, called the O-A diagram, is proposed. By isolating meaningful groups of functions working on common dynamic data, such a diagram can be used to evaluate the encapsulation in a program and to drive possible interventions to improve it. Experimental results suggest that the aggregations identified by the O-A diagram are actually cohesive functions operating on a shared data structure. The results are useful in themselves, by providing the programmer with information about the organization of the accesses to dynamic memory. In addition the O-A diagram permits highlighting violations of encapsulation, so that proper restructuring actions can be performed.