[stringtemplate-interest] Renderer "modes"

Jeremy Gray jgray at siberra.com
Tue Jun 20 14:15:23 PDT 2006


A few comments...

"Well, you'd need one for javascript but what others would you need?"

Long versus short forms for dates and times, percentages versus standard
fractional values, escaped versus unescaped string data (eg.
system-controlled string values unescaped, user-supplied values escaped,
SQL-escaped, XML-escaped, URL-encoded), and the list goes on. :)


"$sqldb; format="SELECT * FROM USER"$

yikes!  Boy that is a slippery slope, eh?  This is why I am so  
ruthless with this infernal separation ;)"

Yup, scary stuff, hence my post about heading that one off at the pass
to avoid falling off the edge. :)


"So, in the controller you register String->SeansHTMLRendererThingie  
and then call $name.seansMethodForManipulatingStringsInACoolWay$.

This prevents the user from passing arbitrary data;"

Precisely. This is why Sean's recommendation works so nicely. The view
still has control over which of a limited set of alternate rendering
forms it wishes to use, but without exposing the slippery slope.


"This way we can automatically add properties essentially to any type of
object."

That reminds me of some work that MSFT is doing on C# 3, but that's
probably best saved for a different thread. Or maybe it isn't. :)

(For those not following it, they are baking "expando"-like extension
methods and properties into the language and IDE.)


"How does this sound?  I like it."

+1

Jeremy



More information about the stringtemplate-interest mailing list