On Monday, August 18, 2003 9:53 AM, Sean Corfield wrote: > > > But my plantSet object "is-a" cached object! Isn't it? > > No, the cached object is an implementation detail, not core to what a > plantSet is. That's why inheritance is not the right approach in this > case: to change the caching strategy you shouldn't have to change what > plantSet inherits from.
Okay, thanks for clarifying. I was really using inheritence as a cheap way to make the innards of the object available to the function I wanted to call. I can easily replace it with a cfmodule or I could move that method into my core CFC. My code is the same for all objects that use the cache, though, so extending was an easy way to share the code. > This whole thing about trying to replace an object with some cached > version is the unnecessary complexity. If your plantSet is meant to be > a Web Service, it should be stateless - have no instance data - and > simply manage the cached data (in server scope, for example). No "this" > scope stuff, no "variables" / unnamed scope stuff - stateless CFCs > don't need that. I think I am basically doing that; my cached variable is called 'instance', I have no other data, and I have a method to put it into the server scope. I'm not caching the methods, just the data that I want cached. ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
