Discussion:
[FreeMarker-user] Is it a bad practice do use a lot of auto importing ?
Albert Kam
2013-05-11 07:09:12 UTC
Permalink
I wonder whether there are tradeoffs to use mostly auto imports rather than
the manual imports ?

I have this doubt since i notice that i have been doing auto import a lot,
even to the point that the imported ftl is only used by another ftl, and is
not likely to be used by other ftl-s in the future.
--
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)
Daniel Dekany
2013-05-11 11:45:19 UTC
Permalink
I wonder whether there are tradeoffs to use mostly auto imports rather than the manual imports ?
I have this doubt since i notice that i have been doing auto import
a lot, even to the point that the imported ftl is only used by
another ftl, and is not likely to be used by other ftl-s in the future.
Importing usually doesn't do a lot (most imports just define a bunch
of macros and the templates are coming from the cache), but if you
have many imported templates it can mean some slowdown. It had to be
measured in the concrete application to find out it matters. Like if
your page rendering consists of running many smaller templates as
opposed to running one big template, I can imagine that it can become
a performance issue.

(BTW, I want to introduce lazy-importing (importing only when you are
actually using the prefix for the fist time) in the future.)
--
Thanks,
Daniel Dekany
Continue reading on narkive:
Loading...