Re: Schema provider/CA lookup status
Martin Aspeli <[email protected]> Fri, 28 Jul 2006 01:03:20 +0100
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
Martin Aspeli wrote: > Okay, so it's calculating the hash key that makes it slow. That makes sense. > > I just don't quite know how we'd invalidate the cache. I suppose we > could define some event that we'd expect people to fire when they > changed the schema... I've done an implementation of that now here: http://dev.plone.org/collective/browser/company/trunk/content/schema.py see also: http://dev.plone.org/collective/browser/company/trunk/interfaces.py The DocTest on ExtensibleSchemaSupport should explain how it all works. Basically, I took VariableSchemaSupport but simplified it a lot. You have to fire an event to invalidate the schema and re-calculate. What do you think of this implementation? Something like this (at least the VarClassGen bit and the implementation of Schema(), perhaps not the ISchemaExtender pattern) would probably have to go into the whitmo-schema-by-interface branch. In that case, we'd do away with the mix-in and make this the default behaviour, of course. It's not terribly complex, though. In 'company', it's going to give me a lot of power and flexibility. :) Martin ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV