[ 
https://issues.apache.org/jira/browse/VELOCITY-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12967090#action_12967090
 ] 

Adrian Tarau commented on VELOCITY-790:
---------------------------------------

During the implementation I started with a few suppositions:
 - used Apache Commons 
Configuration(http://commons.apache.org/configuration/apidocs/index.html), it 
seems like a good model to me(I use it in my projects and it proved to be well 
defined)
 - create the smallest API possible without dropping useful functionality
 - removed the SubConfiguration it doesn't seems to provide much for Velocity
 - removed getTypeXX(key), Velocity should start with default values if no 
configuration is provided, no failures allowed if  a configuration is 
missing(however a ConversionException will be thrown if a conversion to a 
specific type cannot be performed)  
 - kept the concept of a configuration listener just in case in the future 
Velocity will reload itself(parts) at runtime if configuration changes. For 
performance reasons you don't want to get a configuration value at runtime, you 
load it during initialisation in a local(instance) variable and register a 
listener to the configuration if you want to be notified when the configuration 
changes(to reinitialise your internals)
 -  kept the concept of keeping the value of a key as an Object, allowing to 
pass Lists. Also getStringArray/setStringArray looks for a separator(default 
",") to get/set lists.
 - no support for interpolation, implementations like Apache Commons 
Configuration will provide such a functionality
 - provide a ConfigurationFactory as an entry point to get a 
configuration(based on a Map, a File or a String) and all implementations are 
private. Developers can  provide obviously their own Configuration 
implementation and the only restriction is to thread safe(see configuration 
listener)


Any comments are welcomed.

> Improve configuration facility
> ------------------------------
>
>                 Key: VELOCITY-790
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-790
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 2.0
>            Reporter: Antonio Petrelli
>            Assignee: Adrian Tarau
>             Fix For: 2.0
>
>
> Currently the whole configuration of Velocity Engine is managed by 
> ExtendedProperties, a class from Commons Collections.
> An interface that abstracts from this implementation, and an implementation 
> that uses normal Properties should be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to