> > How about also removing the the caches creation to a factory > > CacheFactory.getCache(string name); > > The static getCache method does not create a Cache, it only give one back > which was explicitely 'registered'. A better name would then perhaps be > CacheManager. And why would something like this belong somewhere in a baseclass? > I think you dislike static functions. Personally, I found it more or less > logical to implement such functions staticly, because they are common to all > instances, and only few. I just think that utility methods and factories (excepted for a singletons of course) should be in a separate class because there is no need to put is all there.
Perhaps you are right, I might dislike static functions and in such situations i would always create a utility class or something else. The obvious example is the difference between the first and second storage implementation. take a look at http://www.mmbase.org/api/org/mmbase/storage/database/MySqlStorage.html and try know what you need to override when you want to implement something there are more then 100 methods in there! and compare it to http://www.mmbase.org/api/org/mmbase/storage/implementation/database/RelationalDatabaseStorageManager.html still the implementation is quite complex but with only a few changes (an Manager and a bit of delegation, separate Sheme class) makes a lot of difference. > Actually when you extend a cache you don't need to know about the > static methods. You can simply remark the 'static' markers in the code :-) That of course is very confusing. not only when you extend a class. but even more in the factory code. static String setFunctionImpl = "org.mmbase.util.functions.SetFunction"; in that case is not a SetFunction it's just plain obfuscation
