Easy delegate/wrapper via bytecode-oriented service
---------------------------------------------------

                 Key: TAP5-1841
                 URL: https://issues.apache.org/jira/browse/TAP5-1841
             Project: Tapestry 5
          Issue Type: New Feature
          Components: tapestry-ioc
    Affects Versions: 5.4
            Reporter: Howard M. Lewis Ship


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to