[
https://issues.apache.org/jira/browse/KI-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717284#action_12717284
]
Jeremy Haile commented on KI-81:
--------------------------------
I like the idea of eliminating the fluff interfaces as long as we carefully
think through our reflection approach and as long as we are consistent and
clearly document it. I think the rule should be: 1) If the setter is called
using reflection, it should not fail if the method doesn't exist 2) If it
makes sense that something fails due to the absence of a method, it should be
in an interface.
> 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.