Ok, clever! So I guess we're back to extending PortletConfig to have everything we need for the handle.
- Glenn > -----Original Message----- > From: David Sean Taylor [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 13, 2002 10:51 AM > To: 'Jetspeed Developers List' > Subject: RE: A brief report on Jetspeed Portlet Caching > > > > > > -----Original Message----- > > From: Setera, Craig [mailto:[EMAIL PROTECTED]] > > 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 = > (String)portletClass.getMethod("getHandle",signatureParams) > > .invoke(null,methodParams); > > > 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-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>