portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sean Taylor" <da...@bluesunrise.com>
Subject RE: A brief report on Jetspeed Portlet Caching
Date Mon, 13 May 2002 14:51:03 GMT

> -----Original Message-----
> From: Setera, Craig [mailto:Craig.Setera@Kingland.com] 
> Sent: Monday, May 13, 2002 5:59 AM
> To: 'Jetspeed Developers List'
> Subject: RE: A brief report on Jetspeed Portlet Caching
> Can anyone explain why the cache key creation is a static 
> member?  Looking at the code, I can see that it was 
> originally an instance method and was later changed.  This 
> doesn't make a lot of sense to me to be honest.  This would 
> be like defining static equals() and hashcode() methods.  
> There are at least a couple of things that seems wrong with 
> the current approach:
> 1) As Glenn has stated, the static method does not have 
> access to all of the state information of the cacheable and 
> cannot necessarily generate the best cache key to match.
> 2) Static methods cannot be required to be implemented.  An 
> abstract instance method would force an implementation (with 
> a possible generic implementation in the superclass).  
> In my mind, it seems that we should be switching back to an 
> instance method for cache key generation, with the 
> possibility that some instances delegate to an appropriate 
> static method.  

I believe its static since we haven't yet created an instance in
JetspeedPortletFactoryService, so the method is reflected for the
specific class:

                Class[] signatureParams = { Object.class };
                Object[] methodParams = { pc };
                handle =

I believe the reason that getHandle is static is because they didn't
want to create the object until it was actually needed.
So you get the handle, look it up in the cache. If its not in the cache,
then create the object.

To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>

View raw message