[ 
https://issues.apache.org/jira/browse/KI-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717296#action_12717296
 ] 

Jeremy Haile commented on KI-81:
--------------------------------

One more thought: a lot of our passthrough methods are for configuration.  
Rather than passing through individual configuration params, I think it'd be 
cleaner if we passed through a configuration object that encapsulated the 
config.  (perhaps using a ConfigurationAware interface?)  Then the passed 
through classes could just get whatever configuration they needed.  This would 
also prevent us from having to write additional passthrough methods everytime 
we come up with an additional config param.

> Passthrough configuration methods should probably be reflection-based
> ---------------------------------------------------------------------
>
>                 Key: KI-81
>                 URL: https://issues.apache.org/jira/browse/KI-81
>             Project: Ki
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 0.9-RC1, 0.9
>            Reporter: Les Hazlewood
>             Fix For: 1.0
>
>
> We currently have a lot of methods to support passthrough configuration to 
> wrapped/delegate objects.  
> Most of the time, those passthrough methods are very specific to the 
> underlying wrapped implementation - we do a few 'instanceof' checks to see if 
> the underlying implementation is one of our default implementations or 
> interfaces, and if so, cast the object and then make the call.
> Instead, it might be nicer to just use reflection (or PropertyUtils) to take 
> the delegate object and reflectively call a setter method, without checking 
> for type first.  If the method call fails we could throw a nice message about 
> an unexpected type.
> This would allow us to get rid of a lot of 'fluff' interfaces that might 
> exist solely for passthrough configuration, which only add to bloat and often 
> confusion to those perusing the APIs.

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

Reply via email to