COMPOSITION AND INHERITANCE MODEL COMPARISON

Aleksejs Sergejevs, Sergejs Kodors

Abstract


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.

Keywords


composition; csharp; inheritance; programming

Full Text:

PDF

References


L. Steven. Composition vs. Inheritance: How to Choose? Sk. Internetā (19.04.2019) https://www.thoughtworks.com/es/insights/blog/composition-vs-inheritance-how-choose

Stevenson J., Wood M. Recognising object-oriented software design quality: a practitioner-based questionnaire survey. Sk. Internetā (19.04.2019) https://link.springer.com/article/10.1007/s11219-017-9364-8

Rupak. Inheritance vs composition. Sk. Internetā (20.04.2019)https://www.techjini.com/blog/inheritance-vs-composition/

Dev.Interview. What are advantages of composition and aggregation over inheritance? Sk. Internetā (21.04.2019) http://developer-interview.com/p/oop-ood/what-are-advantages-of-composition-and-aggregation-over-inheritance-14

T. Jignesh. Inheritance VS Composition. Sk. Internetā (21.04.2019)https://www.c-sharpcorner.com/UploadFile/ff2f08/inheritance-vs-composition/




DOI: http://dx.doi.org/10.17770/het2019.23.4394

Refbacks

  • There are currently no refbacks.