0
我們正在將我們的傳統實現移至Spring IBatis模型。我在使用Spring模型使用Spring IBatis對緩存進行延遲初始化
可以說我有兩個班[他們兩人都是單]
DAOImpl實現DAOInterface更清潔的方式將這些對象建模樣的卡
CacheDAOImpl implements DAOInterface
Code snip從DAOImpl表示CacheDAOImpl對象使用
private DAO getCacheDAO()
{
return CacheDAOImpl.getInstance();
}
@Override
public SomeObject lookUpId()
{
return getCacheDAO().lookUpId();
}
在上述實現的緩存寵物表示對象初始化CacheDAOImpl
.....
private static CacheDAOImpl ourInstance = new CacheDAOImpl();
public static CacheDAOImpl getInstance()
{
return ourInstance;
}
private CacheDAOImpl()
{
// intialiazes all caches
}
代碼段僅當方法在DAOImpl被調用初始化而使用Spring初始化模型,我們可以做到這一點嗎? lazy-init可能無法在這裏工作,因爲對象DAOImpl將永遠被非懶惰的bean訪問
@Bozho謝謝。它將永遠被非懶惰的bean訪問。爲了清晰起見,我將編輯帖子。 – Chandra 2010-01-24 09:51:43