Re: [Freemarker-devel] Aquisition patch again (right one) (fwd)
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
From: Jonathan R. <jre...@te...> - 2002-07-24 15:34:56
|
On Wednesday 24 July 2002 08:37 am, Attila Szegedi wrote: > ----- Original Message ----- > From: "Marko Nikolic" <ma...@we...> > To: "Attila Szegedi" <sze...@fr...> > Cc: <fre...@li...> > Sent: 2002. július 24. 12:55 > > > Sure, but is there a problem to add > > > > Configuration.acquireTemplate(String templateBase, String resourceName, > > ...) > > > > Then include will see if acquisition is enabled or not and call > > appropriate method and developer can choose what to call for master > > template. > > Technically, there is no problem. In fact, we could have > Configuration.getTemplate(String templatePath, Locale locale, String > encoding) and > Configuration.getTemplate(String basePath, String resourcePath, Locale > locale, String encoding) > and the latter would imply that we're using acquisition. Of course, this > would mean > a) we have one more getTemplate() method - maybe we should revisit where do > we use others and axe those we don't use because most of them are > convenience methods anyway; > b) the acquisition logic moves into either Configuration or TemplateCache. > Moving it into TemplateCache looks like being the better idea since then > the results of acquisition lookup could also be subject to caching (=better > performance). > > As I said, I like the idea but would like to hear the opinions of fellow > developers (at least Jonathan) before actually jumping at implementing the > feature. I haven't formed a very strong opinion about this. The only thing I am wondering is how this interacts with the way we are dealing with locales. After all, looking for foo_en_US.html and then foo_en.html and then finally settling for foo.html is not so dissimilar to the acquisition idea. Except that we are not using directories. Actually, using a directory-based scheme for the localized files could be somewhat better. Though OTOH, our current way is following the standard java naming for localized resources. (FWIW) Well, actually, I'm kind of on holiday now. Anyway, you have sort of taken ownership of the caching code, I think. One thing I would say about this is that we need a design goal where the added functionality is non-intrusive for people who don't use it. I mean, the majority of people are surely not leveraging the locale-based template lookup, but I don't think it imposes any complexity on people who don't use it. Similarly, any other features introduced should not complicate life for the people who don't use it. Ciao, Jonathan > > Attila. > > > -- > > Marko Nikolic - Chief Application Developer > > > > Webtomic d.o.o. (http://www.webtomic.net) > > Milana Tankosica 27, YU-11000 Beograd > > Phone: +381(11)3290-325 > > Fax: +381(11)766-844 > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Freemarker-devel mailing list > > Fre...@li... > > https://lists.sourceforge.net/lists/listinfo/freemarker-devel > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Freemarker-devel mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freemarker-devel |