Sunday, January 06, 2008

problems with convenience methods

Currently in CowDb there are many convenience methods on PersistenHandle and HandleTable. Aside from cluttering up these classes, Java's lack of mixins or multiple inheritence make it very difficult to add to the convenience methods in subsequent layers (COODBMS being a case in point, but this applies to applications as well). The answer is to change these methods to static and move them to the classes they apply to. So rather than having a getList(String key) method on HandleTable, we'll have PList.get(IHandleTable handleTable, String key) method.

Ugh! This is not the nicest oo practice, but at least it is extensible. It also means I've got a big refactoring job to do in CowDb, and right after announcing 0.9 as a beta release. Well, there is still a silver lining here--this will not require any changes in the data in the database, so we will still have backward compatibility with the db file.

0 Comments:

Post a Comment

<< Home