Implementation Variants of the Singleton Design Pattern

Stencel, K; Węgrzynowicz, P

  • On the Move to Meaningful Internet Systems: OTM 2008 Workshops;
  • Tom: 5333;
  • Strony: 396-406;
  • 2008;

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