Singleton keeps track of all the available connections and hands them out as they are available. (Here) Applicability o 当类只能有一个实例而且客户可以从一个众所周知的访问点访问它时 o 当这个唯一实例应该是通过子类化可扩展的,并且客户应该无需更改 代码就能使用一个扩展的实例时
the instantiation of an object to one instance. In practice: never. Ref: http://stackoverflow.com/questions/3319434/singleton-pattern 1.违反了单一职责原则。 2.耦合度过大。 3.单元测试基本无法进行,因为单元测试中各个测试用例是彼此独立的, 而单例模式下这是违反的。 4.开发混淆,造成困惑。 There‘s at most a can use but there no need.