Feature Proposal: improve internal cachebility of TopicObjects by differentiating writeable Meta objects.


we open, parse and throw away a much larger number of TopicObjects than change and save them.

If we differentiate normal, readonly TopicObjects from writeable ones, we could more safely cache them, and more carefully control how we treat the lifecycle of writeable instances.

Description and Documentation

in essence, I'm thinking that a Meta Object is created with no 'Setters' and with the data more difficult to get to (in a write context), and to add a ->getWriteableCopy() that would specifically make a copy of the object that then has setters and the infrastructure to write.

thus we might have a Meta and a WriteableMeta class..

This can give us speedup possibilities for the most common use, security, because we don't pass around a topic object that can be modified accidentally...

in combination with PromoteMetaDotPmToFirstClassAPI, we can then use the Foswiki::MetaCache to re-use these static topic object to speed up repeated requests to Foswiki::webExists etc (which happen alot), and we can also quietly pre-load the cache for this info using SEARCHes, rather than accessing directory or topic files individually.

It might be worth considering renaming the class to avoid confusion - no idea what to tho (Item and WriteableItem class seems quite unedifying).





-- Contributors: SvenDowideit - 14 Nov 2010


superceeded and subsumed by SimplifyTheStoreMetaSemantics

-- SvenDowideit - 19 Aug 2011
Topic revision: r2 - 19 Aug 2011, SvenDowideit - This page was cached on 06 Aug 2020 - 05:56.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy