首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

单例模式跟软引用[Soft Singleton Idiom]

2012-08-27 
单例模式和软引用[Soft Singleton Idiom]原文出自:http://www.javaworld.com/community/node/7692?There a

单例模式和软引用[Soft Singleton Idiom]

原文出自:http://www.javaworld.com/community/node/7692

?

There are two ways singletons are created using the Double Check Locking and the Holder Idiom for lazy loading. Both of them create a static singleton object which does not help garbage collection much.
In search of a new way to create singleton without using static object came across this solution which gets rid of creating object in static way and also helps garbage collection as we wrap singleton object with Soft Reference.

?


?

?

?

?

?

?

?

热点排行