Static Versus Dynamic Polymorphism When Implementing Variability in C++
Samer Al Masri · ERA: Education and Research Archive (University of Alberta) · 2019
Software Product Line Engineering (SPLE) creates configurable platforms that can be used to efficiently produce similar, and yet different, product variants. To implement SPLs, multiple variability implementation mechanisms have been suggested, including polymorphism. In this thesis, we talk about the trade-offs of using static versus dynamic polymorphism through a case study of IBM’s open-source Eclipse OMR project.Eclipse OMR is an open-source C++ framework for building robust language runtimes. To support the diverse languages and architectures targeted by the framework, OMR’s variability implementation uses a combination of build-system variability and static polymorphism. OMR developers now realize that their current static polymorphism implementation has its drawbacks and are considering using dynamic polymorphism instead.In order to study the trade-offs of using different kinds of polymorphism in OMR, it is crucial to collect function information and overload/override statistics about the current code base. Hence, we create OMRStatistics, a static analysis tool that collects such information about OMR's source code. Using the information provided by OMRStatistics, OMR developers can make better design decisions on which variability extension points should be switched from static polymorphism to dynamic polymorphism. In addition, we report on our first hand experience of changing the polymorphism used in OMR's variability implementation mechanism from static to dynamic, the challenges we faced in the process, and how we overcame them.