看似容易,其实还是有点学问的。

Singletong 的最大容易被忽略的问题,是 serialization 以后,deserialization 时弄不好,会创造新的 instance. 当然,前提是,你的 class implements Serializable 才有可能会这样。

所有跟帖: 

噢,谢谢。我还真没用过serialization /deserialization -戏雨飞鹰- 给 戏雨飞鹰 发送悄悄话 戏雨飞鹰 的博客首页 (762 bytes) () 03/05/2009 postreply 20:43:54

basiaclly yes. -mdq100- 给 mdq100 发送悄悄话 mdq100 的博客首页 (237 bytes) () 03/05/2009 postreply 20:55:48

Thanks, 100... -戏雨飞鹰- 给 戏雨飞鹰 发送悄悄话 戏雨飞鹰 的博客首页 (0 bytes) () 03/05/2009 postreply 20:58:13

请您先登陆,再发跟帖!