The design of this class ensures that only one Singleton object is ever created.
此类的设计确保只创建一个Singleton对象。
So if you serialize one singleton twice, the two serialized objects take on separate identities.
所以如果两次序列化一个单例对象,这两个序列化得到的对象会持有两个不同的标识。
It is often seen as an antidote for many of the problems that using Singleton brings in its wake (and, as an aside, Singleton was one pattern we did _not_ include in the book :->).
它常常被视为使用Singleton之后带来的许多问题的解毒剂(并且,作为题外话,Singleton是我们没有包含在本书中的一个模式:->)。
应用推荐