Stencel, K; Węgrzynowicz, P
We present a study of different implementation variants of the Singleton pattern and propose an intuitive definition of this pattern expressed as a first-order logic formula. We also show that our method for automatically detecting design patterns can be used to detect instances of the Singleton with respect to this definition. We also provide data on experiments with a proof-of-concept implementation of this detection method. These experiments prove the efficiency and high accuracy of the method, which is able to detect many non-standard variants of the Singleton in real source code.
Keywords: computing