You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2014/04/16 00:27:16 UTC

[jira] [Closed] (TAP5-375) Provide some way to bind services without explicit binder.bind() calls or builder methods

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

Howard M. Lewis Ship closed TAP5-375.
-------------------------------------

    Resolution: Invalid

I think less magic is actually better.  If I were designing IoC today, there wouldn't be any manifest-loader magic at all.

> Provide some way to bind services without explicit binder.bind() calls or builder methods
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-375
>                 URL: https://issues.apache.org/jira/browse/TAP5-375
>             Project: Tapestry 5
>          Issue Type: New Feature
>    Affects Versions: 5.0.16
>            Reporter: Thiago H. de Paula Figueiredo
>            Priority: Minor
>              Labels: tapestry5-review-for-closing
>
> Full discussion at http://www.nabble.com/Tapestry-IoC%3A-binding-service-without-code%2C-just-convention-over-configuration-td20585891.html.
> I have been wondering about some ways to write even less configuration with Tapestry-IoC and yet more convention over configuration.
>  
> At first we had:
>  
> public static void bind(ServiceBinder binder) {
> 	binder.bind(Service.class, ServiceImplementation.class);
> }
>  
> Then, if ServiceImplementation is in the same package, we can write:
>  
> public static void bind(ServiceBinder binder) {
> 	binder.bind(Service.class);
> }
>  
> I'm thinking of not even have that binder.bind() call, automatically binding services located in packages defined by some convention. How could I implement that? Can we add services to a Registry or use ServiceBinder just like we can use add objects to a service distributed configuration? I spent some time looking at the Tapestry sources, but I couldn't find an answer.
>  
> Another related funcionality I was thinking was to automatically provide some well-know service implementations when no one was explicitly providaded. Example: suppose we have the convention that every entity class must a corresponding controller class. Then I want to provide a default controller implementation for it if none is provided, because some components and pages expect one controller instance for each entity class. How could I do that?
>  
> My goal is to to have non-trivial zero configuration (or almost zero configuration) applications in Tapestry, provided that they follow the conventions.
> Em Wed, 19 Nov 2008 15:31:16 -0300, Howard Lewis Ship <hl...@...>   
> escreveu: 
> > Interesting idea.  You could probably put something together around 
> > ClassNameLocator, i.e., a wrapper that given package names, find 
> > interfaces inside those packages that have matching Impl classes. i.e. 
> > 
> > public static void bind(ServiceBinder binder) 
> > { 
> >   new AutoServiceBinder("my.package.root").bind(binder); 
> > } 
> How can I get a ClassNameLocator instance in bind(ServiceBinder binder)? 
> Trying to inject through public static void bind(ServiceBinder binder,   
> ClassNameLocator classNameLocator) does not work (method is never   
> invoked). It must be static, so I cannot use a constructor in my module   
> class. 
> And what about the creation of default implementation for unbound services?



--
This message was sent by Atlassian JIRA
(v6.2#6252)