Out of band session caching

0 views
Skip to first unread message

Edward Sumerfield

unread,
Sep 30, 2009, 8:09:42 AM9/30/09
to Cincinnati Ruby Brigade
How would you do this in Rails. I am looking to re-implement an old
favorite solution in a Java app but couldn't think how Rails would do
it, and of coarse, how Rails does it is how we do everything in Java
these days :-)

Goal:

1) cache some data with session scope.
2) achieve this without adding any code to the view, business or data
loading logic.

Java Solution:

To do this in Java I would perform 3 basic steps:

1) Centralize construction of all DAO objects with factories or Spring etc.
2) Add servlet filter to intercept request, and copy session into
persistence object stored in thread local.
3) Make DAO construction wrap dynamic proxy around each dao method and
use persistence object to check for available cached data. If none
retrieving and storing the data into persistence object.

Ed

Reply all
Reply to author
Forward
0 new messages