Tapestry 5
  1. Tapestry 5
  2. TAP5-69

Add annotation, @Contribute, to allow service contributor methods to be arbitrary named

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.15
    • Fix Version/s: 5.2.0
    • Component/s: None
    • Labels:
      None

      Description

      Tapestry used to require this naming convention for configuring services:

      public static Foo buildFoo(...)

      {...}
      public static void contrubuteFoo(...) {...}

      Then it allowed the first convention to be simplified as:
      public static Foo build(...)

      {...}

      It would be nice for the "contribute..." methods to allow also simpler naming and use the type of the "configuration" parameter to determine the configured service, which will also have the same type of parameter.
      For example:

      in Tapestry 5.0.5 TapestryModule.java:
      public ServletApplicationInitializer build(..., List<ServletApplicationInitializerFilter> configuration, ... )

      in my AppModule.java Tapestry 5.0.5 requires this naming:
      public void contributeServletApplicationInitializer(OrderedConfiguration<ServletApplicationInitializerFilter> configuration)

      Perhaps it could be simplified as:
      public void contribute(OrderedConfiguration<ServletApplicationInitializerFilter> configuration)

      If it will not be simplified, it would be nice to make the documentation about Tapestry IoC Configurations more clear that
      the naming of the contribute methods is important, not the type of configuration parameter.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Igor Drobiazko
              Reporter:
              Kalin Krustev
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development