vineri, 16 iulie 2010

Singleton <-> Static classes

Singleton <-> Static classes 


When singleton and not static classes:
  • Create multiple singletons that start from the same class ()
  • Instance returned by the Instance property could be an interface (the class can be an implementation of an interface)
    • You can use singletons with interfaces just like any other class
  • You can derived the singleton class (in order to extend the functionality)
  • Unlike static classes, we can use singletons as parameters or objects


Niciun comentariu:

Trimiteți un comentariu