Research on Approaches to Implementing Run-Time Polymorphism in the C# Programming Language

Ілона Володимірівна Шевченко, Павло Олександрович Лучшев, Оксана Вадимівна Лучшева

Abstract


The article examines approaches to implementing dynamic (run-time) polymorphism in the C# programming language. Polymorphism is one of the key principles of object-oriented programming, providing flexibility, reusability, and extensibility of program code. The study focuses on various mechanisms for implementing polymorphic behavior, in particular through virtual methods, abstract classes, interfaces, delegates, and the dynamic type. A comparative analysis of these approaches has been carried out, identifying their advantages, limitations, and practical areas of application. The provided code examples demonstrate the operation of each mechanism in real-world scenarios, allowing for the evaluation of their appropriateness depending on the requirements of a specific programming task. Special attention is given to ensuring compliance with the SOLID principles and the flexibility of software architecture. As a result, recommendations are formulated regarding the choice of the optimal mechanism for implementing dynamic polymorphism in different contexts. The findings may be useful for students and educators, as well as for practicing software developers.

Keywords


C#; object-oriented programming; polymorphism; run-time; virtual methods; abstract classes; abstract methods; interfaces; delegates; dynamic

References


Sarcar V. Simple and Efficient Programming with C#: Skills to Build Applications with Visual Studio and .NET. – 2nd ed. – Berkeley, CA, USA : Apress, 2022. – 313 p. – DOI: https://doi.org/10.1007/978-1-4842-8737-8.

Panjuta D. Learning C# Through Small Projects / D. Panjuta, J. Jabbarzadeh. – 1st ed. – Cham, Switzerland : Springer, 2024. – 391 p. – DOI: https://doi.org/10.1007/978-3-031-51914-7.

Alls J. Clean Code with C#: Refactor Your Legacy C# Code Base and Improve Application Performance Using Best Practices. – Birmingham, UK : Packt Publishing Ltd, 2023. – 492 p.

Bhalla S. S. Programming in C#: Exam 70-483 (MCSD) Guide / S. S. Bhalla, S. M. Gorthi. – 1st ed. – Birmingham, UK : Packt Publishing, 2019. – 444 p.

Taher R. Hands-On Object-Oriented Programming with C#: Build maintainable software with reusable code using C#. – Birmingham, UK : Packt Publishing, 2019. – 288 p.

Bancila M., Rialdi R., Sharma A., Esposito D. Learn C# Programming: A guide to building a solid foundation in C# language for writing efficient programs. – Birmingham, UK : Packt Publishing, 2020. – 636 p.

Troelsen A., Japikse P. Pro C# 10 with .NET 6. – Berkeley, CA, USA : Apress, 2022. – 1640 p. – DOI: https://doi.org/10.1007/978-1-4842-7869-7.

Price M. J. C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals: Start building websites and services with ASP.NET Core 9, Blazor, and EF Core 9. – 9th ed. – Birmingham, UK : Packt Publishing, 2024. – 828 p.

Donchev I. Dynamic Polymorphism without Inheritance: Implications for Education / I. Donchev, E. Todorova // International Journal of Advanced Computer Science and Applications (IJACSA). – 2022. – Vol. 13, No. 10. – P. 643–649. – DOI: http://dx.doi.org/10.14569/IJACSA.2022.0131075.


Refbacks

  • There are currently no refbacks.