[ 
https://issues.apache.org/jira/browse/TAPESTRY-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kalin Krustev updated TAPESTRY-1679:
------------------------------------

        Fix Version/s:     (was: 5.0.3)
          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)



  was:
Threre's a strong pattern for service builders of the form:

Foo buildFoo(...) { ... }

In fact, virtually all service builders are of this form.  

Seems like a Dont Repeat Yourself violation.  

Foo build(...) {...}

seems completely reasonable; determine the service id from the service 
interface name (the unqualified part).

Obviously, the current behavior would be left for the reasonable cases where 
you need to provide a specific service id.

    Affects Version/s:     (was: 5.0)
                       5.0.5

> Allow service configurators to be arbitrary named and determine sevice by the 
> configuration parameter
> -----------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1679
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1679
>             Project: Tapestry
>          Issue Type: New Feature
>          Components: tapestry-ioc
>    Affects Versions: 5.0.5
>            Reporter: Kalin Krustev
>            Assignee: Howard M. Lewis Ship
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to