tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stacy Young <>
Subject RE: Query Caching
Date Sun, 30 Sep 2001 02:48:24 GMT
What you've just described does not really apply to my environment. I hardly
implement any of the business logic, if any at all, in the front
end...Unless it's a smaller application that I'm rolling out, then sure...
Does this mean there aren't any DB Tags with caching functionality?  ;-)

-----Original Message-----
From: Reynir Hübner [] 
Sent: Saturday, September 29, 2001 11:46 AM
Subject: RE: Query Caching


One of ideas of the MVC pattern/architecture (MODEL/VIEW/CONTROLLER) is to
keep the buisnesslogic out of the presentation logic and vice versa.
This means keep what the controller should be doing (such as data
manipulation, etc.) out of what the view should be doing - present your data
in some format. Some people are using the JSP page as a controller and the
tags as buisnesslogic to be preformed and then in the end use the JSP page
also as view.

this means the JSP layer serves both the controller and view purpose. The
results of usage like this is the fact that the View layer of the model can
come very expensive, holding all the logic both for presentation and most of
the buisnesslogic too. This means if your website want´s to change it´s
layout, or maybe start some service using XML or WML or something like that,
you must implement all the buisnesslogic again for those different layouts.
Also if you wanted to change the database you want to use, for example port
your application from using Oracle over to useing MySQL you will have to
change the presentation layer (that is if you use some oracle specific
functionality), and probably everything else in your app, at least you would
have to change the tags that interact with the server. And if you are using
3rd party tags you get into troubles there...Maybe in some projects it´s not
relevant, and there for its alrigth to use db-tags or what ever other
functionality inside JSP pages. I cannot see that as "not breaking the MVC


-----Original Message-----
From: Stacy Young []
Sent: 28. september 2001 23:47
To: ''
Subject: RE: Query Caching

Breaks MVC? Not mine! (Fusebox) 

-----Original Message----- 
From: Geoff Lane [ <> ] 
Sent: Friday, September 28, 2001 6:52 PM 
Subject: Re: Query Caching 

Slightly off topic - but I've noticed A LOT of the traffic on this list is
about the DB Tag related stuff. Am I the only one who thinks that the whole
idea of DB tags (for anything other than a very trivial site) is really a
Bad Idea?

It just seems to me that the domain of storage and retrieval lies way
outside the domain of display. I'm willing to hear opinions on why people
use these - but they totally break MVC (which not everyone cares about I

And - if the queries where being done in regular Java and only being
accessed from Tag Labraries - then adding a layer of caching with a
WeakHashmap or something would be rather trivial - then you'd just have a
little penalty on a cache miss of having to do the query and add the value
back into the cache.

On that note - you might be able to sub class the DB Tags to have the
caching done based on the Query and some parameters passed in. Basically,
you'd need a singleton instance of the Cache class so that all the tags
could reference the same object (guess you'd need to do some synchronizing
on the object whenever you updated the cache). Not sure if singletons get
GCed - since they keep a reference to an instance of themselves - one for
someone who knows a lot more about the details of the VM than me.

Maybe a starting point at least . . . 

On Fri, 2001-09-28 at 16:58, Stacy Young wrote: 
> Is there a taglib that supports query caching? Say for isntance I'm 
> using a SQL Taglib to execute a database query, I'd like to hold the 
> results in memory for X amount of time so subsequent queries of the 
> same "id" are pulled from memory and not another trip to the DB. 
> Thanks! 
> Stacy Young 
> Surefire Commerce 
> tel: 514-380-2700 ext 3234 
> <>
< <> > 
> "It all started with a Mouse." -Walt Disney 
Geoff Lane <> 
Ph: (773) 972-7136 
PGP Key:

View raw message