DOI: https://doi.org/10.32515/2664-262X.2022.5(36).1.98-104

Object-oriented Approach in Programming. Compositional in Teraction of Objects

Oleksandr Ulichev, Kostiantyn Buravchenko, Liudmyla Polishchuk

About the Authors

Oleksandr Ulichev, PhD in Technics (Candidate of Technics Sciences), Central Ukraіnian National Technical University, Kropyvnytskyi, Ukraine, e-mail: askin79@gmail.com, ORCID ID: 0000-0003-3736-9613

Kostiantyn Buravchenko, PhD in Technics (Candidate of Technics Sciences), Central Ukraіnian National Technical University, Kropyvnytskyi, Ukraine, e-mail: buravchenkok@gmail.com, ORCID ID: 0000-0001-6195-7533

Liudmyla Polishchuk, викладач, PhD in Technics (Candidate of Technics Sciences), Central Ukraіnian National Technical University, Kropyvnytskyi, Ukraine, e-mail: pli_80@ukr.net, ORCID ID: 0000-0001-5093-1581

Abstract

This article aims to consider the types of interaction, in particular the compositional interaction between objects, and to identify the characteristics of individual types. The aim of the article is to clarify the essence of the concepts of different types of relationships between classes. The article proposes a number of theses that illustrate the ambiguity of the interpretation of concepts - types of connections. In the following calculations, different types of interaction are illustrated by examples and one of the options for interpretation and classification of compositional interaction is proposed. Analysis of a number of literature sources and articles in professional forums leads to the conclusion that the question of specifying the types of interaction and determining - which of the types should be implemented in a given case, is quite complex, despite the simplicity of its formulation. Some theses: 1) At the level of the basic definitions of OOP: composition is one of the types of interaction between objects in OOP (along with aggregation and association). But even at this stage, contradictions were found, in some sources the authors describe (suggest) that aggregation and composition are subspecies of association; 2) Many publications consider the interaction of objects at the level of opposition of "inheritance" and "composition". And this approach involves considering the interaction of objects at a higher level of abstraction, it is not considered the mechanisms of OOP, but rather the philosophy of the programming paradigm and the objective way of thinking; 3) In fact, there are no clear formal rules and restrictions (most modern OOP languages are quite flexible) and a specific approach to interaction between objects in building the object hierarchy is chosen directly by the developer (architect, programmer, etc.). The question of compliance of one or another configuration of the interaction of objects with the principles of OOP is very ambiguous. The flexibility of the OOP is both an advantage and a disadvantage of the paradigm at the same time, and this particular issue of the interaction of objects once again demonstrates this fact. There are two main interpretations of the relationship, one formed in the Society of C ++ developers (taking into account the peculiarities of OOP in this programming language), the other is based on the principles and specifications of UML. Thus, although UML placed the terms "aggregation" and "composition" in a specific context ("part-whole" relationship), but the authors of the notation failed to define them clearly and unambiguously, the decision is largely left to the intuition of developers.

Keywords

Object-oriented programming, UML, aggregation, association, composition, objects relationship

Full Text:

PDF

References

1. Bublyk, V.V. (2015). Ob'iektno-oriientovane prohramuvannia [Object-oriented programming] . Kyiv: ITknyha [in Ukraine].

2. Vajsfel'd, M. (2014). Ob#ektno-orientirovannoe myshlenie [Object-oriented thinking]. Moscow: Piter [in Russian].

3. Dzhim Arlou, Ajla Nejshtadt (2007). UML 2 and the Unified Process. Practical object-oriented analysis and design. (2d ed.) . Isd: Simvol-Pljus [in Russian].

4. Steven Lowe. Kompozicija ili nasledovanie: kak vybrat' [Composition or inheritance: how to choose]. Retrieved from https://habr.com/ru/post/325478[ in Russian].

5. Kompozicija. Vzaimnoe sushhestvovanie kontejnera i kompoziruemogo ob#ekta, forum Stack Overflow [Composition. Mutual existence of container and composable object, Stack Overflow forum]. ru.stackoverflow.com. Retrieved from https://ru.stackoverflow.com/questions [ in Russian].

6. Habr. Avtor Gamos. Nasledovanie, kompozicija, agregacija [Inheritance, composition, aggregation]. Retrieved from https://habr.com/ru/post/354046/ [ in Russian].

7. Kun, T. (2009). Struktura nauchnyh revoljucij [The structure of scientific revolutions]. Moskow [ in Russian].

8. Hajdarov, K.A. Ob#ektno-orientirovannoe programmirovanie [Object Oriented Programming]. Retrieved from http://bourabai.kz/alg/oop.htm [ in Russian].

9. Aggregation. december 7th, 2007 / last modified by alex on december 21st, 2020. Retrieved from https://www.learncpp.com/cpp-tutorial/aggregation [ in English].

10. Difference between Association, Composition and Aggregation in Java, UML and Object Oriented Programming. Retrieved from https://javarevisited.blogspot.com/2014/02/ifference-between-association-vs-composition-vs-aggregation.html [ in English].

11. Sokolov, V.V. (2017). Primenenie funkcionalnoi i reliacinoi modelei v ob#ektno-orientirovannomprogrammirovanii [Application of functional and relational models in object-oriented programming]. Information Technology and Security, Vol. 5, Iss. 1 (8), 54-62 [ in Russian].

12. Lavrishcheva, K.M. (2008). Programna ingeneriia [Software Engineering]. Kyiv: AcademPeriodika [in Ukraine].

GOST Style Citations

  1. Бублик В.В. Об’єктно-орієнтоване програмування: підруч. К.: ІТкнига, 2015. 624 с.
  2. Вайсфельд, М. Объектно-ориентированное мышление. М.: Питер, 2014. 998 c.
  3. Язык UML 2 и Унифицированный процесс. Практический объектно-ориентированный анализ и проектирование, 2-ое изд. Джим Арлоу, Айла Нейштадт; Исд: Символ-Плюс, 2007.
  4. Композиция или наследование: как выбрать, статья Хабр. Автор оригинала: Steven Lowe. URL: https://habr.com/ru/post/325478/ (дата звернення: 28.06.2021)
  5. Композиция. Взаимное существование контейнера и композируемого объекта, форум Stack Overflow. URL: https://ru.stackoverflow.com/questions (дата звернення: 27.06.2021)
  6. Наследование, композиция, агрегация, статья Хабр. Автор Gamos. URL: https://habr.com/ru/post/354046/ (дата звернення: 29.06.2021)
  7. Кун Т. Структура научных революций. М., 2009. 310 с.
  8. Хайдаров К.А. Объектно-ориентированное программирование. URL: http://bourabai.kz/alg/oop.htm (дата звернення: 28.06.2021)
  9. Aggregation. december 7th, 2007 / last modified by alex on december 21st, 2020. URL: https://www.learncpp.com/cpp-tutorial/aggregation/ (дата звернення: 28.06.2021)
  10. Difference between Association, Composition and Aggregation in Java, UML and Object Oriented Programming URL: https://javarevisited.blogspot.com/2014/02/ifference-between-association-vs-composition-vs-aggregation.html (дата звернення: 29.06.2021)
  11. Соколов В. В. Применение функциональной и реляционной моделей в объектно-ориентированном программировании. Information Technology and Security. 2017. Vol. 5. Iss. 1 (8). С. 54-62.
  12. Лавріщева К.М. ПРОГРАМНА ІНЖЕНЕРІЯ. К.: АкадемПеріодика, 2008. 319 с.
Copyright (c) 2022 Oleksandr Ulichev, Kostiantyn Buravchenko, Liudmyla Polishchuk