[stringtemplate-interest] C# static methods

Zenaan Harkness zen at freedbms.net
Fri Sep 22 16:46:55 PDT 2006


On Fri, Sep 22, 2006 at 08:29:16AM -0700, brian.kejser at protexis.com wrote:
> Hi
> 
> Is there another way of using embedded string templates in VS 2005 that
> does not involve using the static method RegisterGroupLoader on the
> StringTemplateGroup class?
> 
> If not, is there any reason why this method (and the corresponding static
> member variable) can't be made non-static?

Not that I know of. This is currently on-topic, for threading
issues as well.

> If I make some quick changes to temporarily implement this functionality
> before a better solution can be found, can the changes be merged into the
> source tree?

It's up to Ter what he puts in his tree of course.

+1 from me for un-staticizing ST! Make it setGroupLoader, etc.

+1 from me for un-synchronizing ST at the same time as
un-staticizing ST, until and unless a clear synchronization model
for ST is documented. The old JGL/Generic Collection Library for
Java, had nice algorithmic performance documentation, and I think
also synchronization documentation, which was very well done from
my memory.

Already, the synchronization that may be in ST cannot be relied
upon if you have multiple threads accessing the same
StringTemplate instance! There a races galore!

But that's not a bad thing in my book, just that you need to (and
should) have the simplest possible access model your app can
accomodate anyway. Demonstrate that you need to have multiple
threads accessing the same ST, and only then, based on access
patterns, can you consider what the best-performing combinations
of synchronizing and internal containers and ST-user level
synchronization, etc, are going to satisfy your web-server's
performance needs.

Cheers
Zen

-- 
Free Australia - www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.


More information about the stringtemplate-interest mailing list