Memory Usage Comparison in an Android Application: Basic Object-Oriented Programming vs Decorator Design Pattern: Coding styles for keeping low memory usage in a mobile application.
{"title":"Memory Usage Comparison in an Android Application: Basic Object-Oriented Programming vs Decorator Design Pattern: Coding styles for keeping low memory usage in a mobile application.","authors":"Wasana Ngaogate","doi":"10.1145/3548636.3548655","DOIUrl":null,"url":null,"abstract":"This paper explores how an Android application consumes memory when it is developed by two approaches: basic object-oriented programming versus decorator design pattern. Somehow programmers develop applications based on their coding experience without concern of memory usage especially in mobile applications which memory consumption is a critical issue. The deployed Android application of a list of temples which join a Candle Festival is selected as a case study. New functions are assumingly required by users so that the application could provide more services. Two class diagrams are designed based on basic object-oriented programming and based on decorator design pattern before implementation of the two approaches. The problem is what is the better approach for handling an increasing number of services after the application has been deployed. So that the application still consumes less memory as possible. The case-study applications retrieve information from a free REST API. Memory usage is measured by using an emulator and a physical device. The result shows that an Android application which developed by using decorator design pattern consumes more memory although its codes are cleaner and easier to read. Therefore, when a developer applies decorator design pattern, they should pay more attention on unexpected effect of the design pattern. Research in impact of design patterns should also be investigated more.","PeriodicalId":384376,"journal":{"name":"Proceedings of the 4th International Conference on Information Technology and Computer Communications","volume":"39 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-06-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 4th International Conference on Information Technology and Computer Communications","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3548636.3548655","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
This paper explores how an Android application consumes memory when it is developed by two approaches: basic object-oriented programming versus decorator design pattern. Somehow programmers develop applications based on their coding experience without concern of memory usage especially in mobile applications which memory consumption is a critical issue. The deployed Android application of a list of temples which join a Candle Festival is selected as a case study. New functions are assumingly required by users so that the application could provide more services. Two class diagrams are designed based on basic object-oriented programming and based on decorator design pattern before implementation of the two approaches. The problem is what is the better approach for handling an increasing number of services after the application has been deployed. So that the application still consumes less memory as possible. The case-study applications retrieve information from a free REST API. Memory usage is measured by using an emulator and a physical device. The result shows that an Android application which developed by using decorator design pattern consumes more memory although its codes are cleaner and easier to read. Therefore, when a developer applies decorator design pattern, they should pay more attention on unexpected effect of the design pattern. Research in impact of design patterns should also be investigated more.