了解 Dao 模式,它可以用于从缓存中检索数据吗?

Understanding Dao-pattern, can it be used for retrieving data from cache?

我在 the official documentation 中读到了 DAO 模式,但不太清楚它是否可以用于从缓存中检索数据?

正式地说,DAO 是客户端和从某处检索数据的机制之间的附加抽象层。所以,如果数据驻留在缓存中,我想我们不妨将 DAO 称为

public interface UserDao {
    //CRUD operations
}

public class UpdatableCachedUserDaoImpl implements UserDao {
     //Normal dao
     private final UserDao userDao;
     private volatile List<User> cache;

    //Delegates CRUD operation to cache
    //Updates the cache through ScheduledThreadPoolExecutor
    //using the Normal Dao
}

但是把这种缓存相关的逻辑放在DAO中是正确的吗?或者 DAO 旨在精确地与数据源或其他持久存储一起工作?

Data Access Object 模式不说明数据是什么或访问数据的位置。从 DAO 访问缓存是否有意义在很大程度上取决于系统的其他架构。