[ 
https://issues.apache.org/jira/browse/TAMAYA-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15896602#comment-15896602
 ] 

ASF subversion and git services commented on TAMAYA-252:
--------------------------------------------------------

Commit a449f485a057e7ef05c911f0333463dec40b8e60 in incubator-tamaya-site's 
branch refs/heads/master from [~anatole]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-tamaya-site.git;h=a449f48 
]

TAMAYA-252: Unified PropertyValue builder API.


> Use PropertyValue also as SPI for listing of properties in a PropertySource
> ---------------------------------------------------------------------------
>
>                 Key: TAMAYA-252
>                 URL: https://issues.apache.org/jira/browse/TAMAYA-252
>             Project: Tamaya
>          Issue Type: Improvement
>          Components: API, Core
>    Affects Versions: 0.2-incubating
>            Reporter: Anatole Tresch
>            Assignee: Anatole Tresch
>            Priority: Critical
>              Labels: API, Meta-Values, Multi-Values
>             Fix For: 0.3-incubating
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> As of now accessing multiple properties (aka the Map) from a 
> {{PropertySource}} returns {{Map<String,String>}}. This has several drawbacks:
> * When combining maps from multiple sources it may not always be clear, which 
> properties belong to which source, especially when meta-properties are added 
> as well. This quite probably ends up in  mix of meta-properties.
> * The exact formatting of meta-properties can be delayed as well, since with 
> {{PropertyValue}} a multi-value capable abstraction is already in place.
> * Similarly combining values from multiple property sources is simpler 
> because it is possible to more easily add meta-data entries, which may be 
> necessary, e.g. when evaluating collection entries.
> * This also allows evaluation of the raw values (single or all) to be 
> extracted into a separate SPI: This could be added transparently as a core 
> SPI, so the API is not affected here.
> The disadvantage is that this change *breaks the current PropertySource 
> interface*. Similarly it is also useful to adapt 
> *PropertyValueCombinationPolicy and PropertyFilter* to operate on 
> {{PropertyValue·}} instead of {{Map<String,String}}.
> Proposed API change:
> *Old:*
> {noformat}
> public interface PropertySource{
>   [...]
>   Map<String,String> getProperties();
> }
> public interface PropertyValueCombinationPolicy{
>   Map<String,String> collect(Map<String,String> currentValue, String key, 
>                                               PropertySource propertySource);
> }
> public interface PropertyFilter{
>   String filterProperty(String value, FilterContext context);
> }
> {noformat}
> *New:*
> {noformat}
> public interface PropertySource{
>   [...]
>   Map<String,PropertyValue> getProperties();
> }
> public interface PropertyFilter{
>   PropertyValue filterProperty(PropertyValue value, FilterContext context);
> }
> public interface PropertyValueCombinationPolicy{
>   PropertyValue collect(PropertyValue currentValue, String key, 
>                                      PropertySource propertySource);
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to