Singletong 的最大容易被忽略的问题,是 serialization 以后,deserialization 时弄不好,会创造新的 instance. 当然,前提是,你的 class implements Serializable 才有可能会这样。
看似容易,其实还是有点学问的。
所有跟帖:
•
噢,谢谢。我还真没用过serialization /deserialization
-戏雨飞鹰-
♀
(762 bytes)
()
03/05/2009 postreply
20:43:54
•
basiaclly yes.
-mdq100-
♂
(237 bytes)
()
03/05/2009 postreply
20:55:48
•
Thanks, 100...
-戏雨飞鹰-
♀
(0 bytes)
()
03/05/2009 postreply
20:58:13