[stringtemplate-interest] StringTemplate type proxies
Sam Harwell
sharwell at pixelminegames.com
Mon Dec 13 05:46:48 PST 2010
Hi Nik,
Like attribute renderers, these would certainly only need to be used for
objects not exposing a necessary view property. However, they can also be
useful because it gives the user a way to express exactly which attributes
are necessary for template output (a documented interface the template and
code writer can see). I chose the name type proxy because it performs
precisely the same function as debugger type proxies in .NET:
http://msdn.microsoft.com/en-us/library/ms228992.aspx. I believe "decorator"
is misleading because these objects do not change the appearance or behavior
of the original objects in any way.
Thanks,
Sam
From: Nikolas Everett [mailto:nik9000 at gmail.com]
Sent: Monday, December 13, 2010 6:10 AM
To: Terence Parr
Cc: Sam Harwell; stringtemplate-interest
Subject: Re: [stringtemplate-interest] StringTemplate type proxies
Displaytag uses a somewhat similar approach that is actually less powerful
then what you're suggesting. May I suggest only dipping to the proxy object
if the normal object doesn't have the field you are looking for? This would
cut down on the (generated) code inside the proxy objects at the cost of not
being able to use them for information hiding. Again, displaytag uses a
similar technique and I find it to be quite useful. Also, would it make
more sense to call these type decorators?
--Nik Everett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20101213/03e2b157/attachment-0001.html
More information about the stringtemplate-interest
mailing list