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

Provide decorators service matching based on annotations

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.0.15
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      It would be very useful if we could match services for decoration using the services' annotations. In spite of documentation saying it can be done, it can't:

      Tapestry IoC documentation:

      "Note: It is not possible to decorate the services of the TapestryIOCModule."

      "Note: Another idea will be other ways of matching services: base on inheritance of the service interface and/or based on the presence of particular class annotations on the service interface. None of this has been implemented yet, and can readily be accompllished inside the decorator method (which will return null if it decides the service doesn't need decoration)."

      If you write a @Match("*"), Tapestry-IoC throws an exception telling that you cannot decorate internal Tapestry-IoC services. Therefore, there's no way to select services to decorate using only annotations: we need to match services based on name patterns in all situations.

      A suggestions is the creation of a @MatchAnnotation() annotation.

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              thiagohp Thiago H. de Paula Figueiredo
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: