Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-68

Passthrough configuration methods should probably be reflection-based

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lhazlewood Les Hazlewood
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: