looking for what kind of function u will expose with exceptions etc...
Anonymous
3 Jan 2012
What was the answer for this?
My answer would be we should apply adapter design pattern (or bridge) into this question since we could cache data using many storage engine (file, memcache, db).
Anonymous
21 Oct 2012
From answer is Cache with Proxy pattern
package xyz;
public interface Data{
public String getData();
}
package xyz;
class RealData implements Data{
private String data;
RealData(String data){
this.data = data;
}
public String getData(){
return data;
}
}
package xyz;
public class CacheDataProxy implements Data{
private String data = null;
private RealData realData;
public CacheDataProxy(){
realData = new RealData();
}
public String getData(){
if(data == null){
data = realData.getData();
}
return data;
}
}