Aleksejs Sergejevs, Sergejs Kodors


The inheritance seems to be the natural and the default solution of structuring the logic of software nowadays. But is it always the best option? Considering the increasing need for programming and the speed at which the projects are made, it’s inevitable that the requirements of a project will be changing many times and a lot of fundamental building blocks in the software will have to be redeveloped. The problem with inheritance is that with a change in functionality it may become necessary to rewrite huge amounts of old code or even end up duplicating existing functionality which only makes things worse in a long run. An excellent solution that can be used to avoid essentially getting stuck in situations like these is composition. The goal of the study is to analyze the pros and cons of composition and inheritance and make a conclusion about their correct usage.


composition; csharp; inheritance; programming

Full Text:



L. Steven. Composition vs. Inheritance: How to Choose? Sk. Internetā (19.04.2019)

Stevenson J., Wood M. Recognising object-oriented software design quality: a practitioner-based questionnaire survey. Sk. Internetā (19.04.2019)

Rupak. Inheritance vs composition. Sk. Internetā (20.04.2019)

Dev.Interview. What are advantages of composition and aggregation over inheritance? Sk. Internetā (21.04.2019)

T. Jignesh. Inheritance VS Composition. Sk. Internetā (21.04.2019)



  • There are currently no refbacks.