METHOD AUTOMATED CLASS CONVERSION FOR COMPOSITION IMPLEMENTATION
DOI:
https://doi.org/10.15588/1607-3274-2024-2-14Keywords:
object-oriented programming, classes, composition, syntactic analysis, class transformationAbstract
Context. Using the composition relation is one of the most effective and commonly used ways to specialize classes in object-oriented programming.
Objective. Problems arise when “redundant” attributes are detected in an inner class, which are not necessary for solving the tasks of a specialized class. To work with such attributes, the inner class has corresponding program methods, whose usage not only does not solve the tasks of the specialized class, but can lead to errors in its work. The purpose of this work is to remove “redundant” attributes from the inner class, as well as all methods of the class directly or indirectly (through other methods) using these attributes.
Method. A mathematical model of the inner class was developed, which allowed us to identify “redundant” elements of the class. The method of internal class transformation is proposed, which, based on the analysis of the class code, provides the developer with information to make a decision about “redundant” attributes, and then in the automated mode gradually removes and transforms the class elements.
Result. To approbate the proposed solutions, a software product Composition Converter was developed. Experiments were carried out to compare the conversion of classes in “manual” and automated modes. The results showed a multiple reduction of conversion time in the automated mode.
Conclusions. The proposed method of automated transformation of the inner class according to the tasks of the outer class when implementing composition allows to significantly reduce the time or the number of errors when editing the code of the inner class. The method can be used for various object-oriented languages.
References
Forouzan B. A., Gilberg R. C++ Programming: An ObjectOriented Approach. McGraw-Hill Education, 2019, 960 р. https://www.booksfree.org/wp-content/uploads/2022/02/CProgramming-An-Object-Oriented-Approach-BehrouzForouzan.pdf
Lee G. Modern Programming: Object Oriented Programming and Best Practices. Packt Publishing, 2019, 266 p.
Kanjilal J. Composition vs. inheritance in OOP and C# [Electronic resource], InfoWord, 2023. Access mode: https://www.infoworld.com/article/3699129/composition-vsinheritance-in-oop-and-c-sharp.html
Kungurtsev O., Bondar V., Gratilova K. Tranforming Classes for Composition Implementation, Modern research in science and education: The 2nd International scientific and practical conference, Chicago, USA, 12–14 October 2023: proceedings. Chicago, BoScience Publisher, 2023, pp. 143–148. ISBN 978-1-73981-123-5
Talcott C., Heinrich R., Duran F. et al. Composition of Languages, Models, and Analyses. New York, Springer, 2021, 311 p.
Kihlman L. Framework for Composition of Domain Specific Languages and the Effect of Composition on Re-use of Translation Rules: abstract of the dissertation … doctor of philosophy in computer science. Essex, University of Essex, 2021, 69 p.
Pfeiffer J., Rumpe B., Schmalzing D. et al. Composition operators for modeling languages: A literature review, Journal of Computer Languages, 2023, Vol. 76, P. 101226
Zhang W., Sun Y., Oliveira B. C. Compositional Programming, ACM Transaction on Programming Lanquages and Systems, 2021, Vol. 43, pp. 1–61 https://doi.org/10.1145/3460228
Nero R. Java inheritance vs. composition: How to choose [Electronic resource], InfoWord, 2020. Access mode: https://www.infoworld.com/article/3409071/javachallenger-7-debugging-java-inheritance.html
Wang L., Du X., Jiang B. et al. KEADA: Identifying Key Classes in Software Systems Using Dynamic Analysis and Entropy-Based Metrics, PubMed, 2022,Vol. 24, № 5, P. 652 DOI: 10.3390/e24050652
Rashidi H., Azadi F. On Attributes of Objects in ObjectOriented Software Analysis, International Journal of Industrial Engineering & Production Research, 2019, Vol. 30, pp. 341–352. DOI: 10.22068/ijiepr.30.3.341
Kungurtsev O., Novikova N., Reshetnyak M. et al. Method for defining conceptual classes in the description of use cases, Photonics Applications in Astronomy, Communications, Industry, and High-Energy Physics Experiments. Vilga, 6 November 2019, proceedings, SPIE P. 11176 doi: 10.1117/12.2537070
Kungurtsev O. B., Vytnova A. I. Determination of inheritance relations and restructuring of software class models in the process of developing information systems, Radio Electronics, Computer Science, Control, 2022, № 4(63), pp. 98–107.
Slivnik B., Mernik M. On Parsing Programming Languages with Turing-Complete Parser, Mathematics, 2023, Vol. 11, Issue 7. https://doi.org/10.3390/math11071594
Slivnik B. Context-sensitive parsing for programming languages, Journal of Computer Languages, 2022, Vol. 73, P. 101172. https://doi.org/10.1016/j.cola.2022.101172
Sudheer N., Hrushikesava S. Different Approach Analysis for Static Code in Software Development, International Journal of Computer Sciences and Engineering, 2016, Vol. 4 (9), pp. 111–118.
Wojszczyk R., Hapka A., Królikowski T. Performance analysis of extracting object structure from source code, 27th International Conference on Knowledge Based and Intelligent Information and Engineering Sytems (KES 2023), 2023 : proceedings, Procedia Computer Science, 2023, Vol. 225, pp. 4065–4073. https://doi.org/10.1016/j.procs.2023.10.402
Kaur S., Singh P. How does object-oriented code refactoring influence software quality? Research landscape and challenges, Journal of Systems and Software, 2019, Vol. 157, P. 110394. https://doi.org/10.1016/j.jss.2019.110394
Wedyan F., Abufakher S. Impact of design patterns on software quality: a systematic literature review, IET Software, 2020, Vol. 14, Issue 1, pp. 1–17. https://doi.org/10.1049/iet-sen.2018.5446
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2024 О. Б. Кунгурцев, В. Р. Бондар, К. О. Гратілова, Н. О. Новікова
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Creative Commons Licensing Notifications in the Copyright Notices
The journal allows the authors to hold the copyright without restrictions and to retain publishing rights without restrictions.
The journal allows readers to read, download, copy, distribute, print, search, or link to the full texts of its articles.
The journal allows to reuse and remixing of its content, in accordance with a Creative Commons license СС BY -SA.
Authors who publish with this journal agree to the following terms:
-
Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License CC BY-SA that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
-
Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
-
Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work.