---
title: "Ehcache缓存模式"
author: "mgoann"
date: "2009-04-17T11:19:20Z"
tags: []
categories: ["企业架构"]
slug: "ehcache"
draft: false
lastmod: "2009-04-17T17:26:53Z"
id: 369406
url: "https://mgoann.iteye.com/blog/369406"
---

**Ehcache缓存模式**

 

**简介**

 

缓存有多种不同的缓存模式。以下是Ehcache支持的缓存模式：

 

[·   直接操作（]()direct manipulation）

·   推送模式（pull-through）

[·   自填充（]()self-populating）

 

 

**直接操作（direct manipulation）**

 

你可以通过方法cache.put(Elemtn element)来存储对象，通过方法cache.get(Ojbect key)来取得对象。

 

 

**自填充（self-populating）**

 

只需要使用cache.get(Ojbect key)来取得对象。Cache自动去构建实体。