Hi Stan,

> Still, I think, it would be a very good idea to slightly redesign
> VelocityEngine class for better support of IoC setup.

## BTW, what does "IoC" stand for?

> You can check out Hibernate to see how they designed it - you
> can configure it in both programmatic and declarative ways - and that
> rocks! :)
> 
> Imagine, how cool it would be to be able to write such code:
> ===
>  velocityEngine.setResourceLoader(customResourceLoader);
> ===
> 
> Or, if Velocity team wants to provide support for multiple resource
> loaders (I guess this is not so common case though), it could be like
> this:
> ===
>  velocityEngine.addResourceLoader(customResourceLoader);
> ===
> 
> customResourceLoader is a programmatically pre-configured ResourceLoader here.
> 
> If the above code could be possible, I'd be happy to donate
> LocaleResourceLoader class for Velocity team and it would greatly
> enrich Velocity product, since i18n is a very common demand.
> 
> What do you think about that? :)

I think it kind of goes against the configure once and only once stated here:
  
http://jakarta.apache.org/velocity/developer-guide.html#The%20Velocity%20Helper%20Class
You could get concurrent issues, too.
Having said that, a mutable ResourceLoader might fulfill your needs. 
(But currently, you can't get the resource loaders from the engine.)

BTW, Velocity supports multiple resource loaders already.  (Not in a
programmatic way, though.)
  http://jakarta.apache.org/velocity/developer-guide.html#Resource%20Loaders
<excerpt>
#
# specify three resource loaders to use
#
resource.loader = file, class, jar
</excerpt>

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to