From: Nathan D. <na...@ch...> - 2002-09-08 04:12:59
|
(welcome to Raymond Camden to modus-devs!) I just checked in a first pass as sorting, with a getAllSorted() method on both the basePersister and an interface to it on the baseContentObject. I'm not totally happy with the implementation, but it does work. I updated the modustest app to sort on the "featured" field descending, then on title, and it works like a charm. I also put some basic caching into the basePersister, but due to the bugs with persistent memory scopes (or perhaps due to some idiocy of my own) it isn't working, so it's forced to never look in the cache right now (the isObjectCached() method always returns false), but once SP1 comes out (assuming it fixes that issue) we can try it out. The current caching does a "one a time" method of caching objects, and each persister implementation can decide how best to use the machinery of the basePersister, which provides: isObjectCached(id) cachePutObject(object) cacheGetObject(id) I implemented this in the simpleObjectInstance persister, and it seems like it will do what it's supposed to do, but I couldn't get it to populate field values properly. Not sure if it's a memory-scope issue or not, though. (I think for 0.2 I'll build a persistence implementation that uses the file system instead of a database, so Modus can be used "out of the box" more easily.) I also built: isCacheInitialized() cacheInit() which are used when the persister is initialized, so a user should never have to think about them. I am still eager to think about the option of using a large XML DOM and xPath to do some truly powerful stuff. The XML would be something like: <contentObjects> <contentObject id="" type="" dateCreated="" dateModified=""> <field name="" value=""> <field name="" value=""> </contentObject> <contentObject id="" type="" dateCreated="" dateModified=""> <field name="" value=""> <field name="" value=""> </contentObject> </contentObjects> - n |