Re: Possible room for performance improvement when using TemplateDirectiveModel and TemplateMethodModelEx
Daniel Henrique Alves Lima <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, Daniel.
On Sat, 2011-01-15 at 10:52 +0100, Daniel Dekany wrote:
> Saturday, January 15, 2011, 1:06:26 AM, Daniel Henrique Alves Lima wrote:
>
>
> TemplateMethodModelEx pretty much corresponds to FTL functions, so
> yes, it will. (Isn't that how you create them now?) (Note that you can
> also have objects that implement both TemplateMethodModelEx and
> TemplateDirectiveModel on the same time.)
I cannot remember why i haven't use the sample implementation for both.
If the same class implement both interface, will FreeMarker execute
TemplateDirectiveModel method for <@x.y> and TemplateMethodModelEx
method for ${x.y}? Maybe i wasn't aware of this before... :-/
>
> (But, of course, if any of these Grails-specific objects are bound to
> a HTTP Request or HTTP Session, then you can't just create them on the
> application level.)
That's why i will try to provide this (shared variables exposure) as an
option.
>
> You will lose it. However here the thing that overrides "g" and the
> affected part of the source code that wants to use "g" are in the same
> file, which is much less worrisome than if something that comes from
> outside hides "g".
Ok.
Thanks.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl