Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1841

Easy delegate/wrapper via bytecode-oriented service

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.4
    • None
    • tapestry-ioc

    Description

      Often you want to decorate just a method or two of a service interface, and let the rest pass through. Currently, that means implementing the full interface.

      it seems that a service with a method like:

      <T> createDelegate(Class<T> interfaceType, Object interceptor, T delegate)

      could be created. It would match each of the methods of the interfaceType against methods of the interceptor object; if such a method exists, the returned proxy invokes the method on the interceptor. Otherwise, it invokes the corresponding delegate method.

      This would make it very easy to decorate just the key methods of an interface.

      A requirement could be that every public method of the decorator MUST match a method of the interface. Otherwise, a refactoring of the interface could silently stop invoking methods of the interceptor.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hlship Howard Lewis Ship
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: