> I'm thinking of not even have that binder.bind() call, automatically binding services located in packages defined by some convention.
Very interesting idea. This mechanism could be something similar to Spring's classpath scanning for managed components: http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-classpath-scanning It would allow us auto-bind services based on regex, annotation or any custom strategy with zero additional configuration. We could for instance use this annotation based strategy: @Service public class MyService implements MyServiceImpl { ... } And IOC registry would be able during startup automatically detect all classes with @Service annotation in some specific package and bind them. I would really like it. On Wed, Nov 19, 2008 at 7:12 PM, Thiago H. de Paula Figueiredo < [EMAIL PROTECTED]> wrote: > Hi! > > 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. > > Thanks in advance. :) > > -- > Thiago H. de Paula Figueiredo > Independent Java consultant, developer, and instructor > http://www.arsmachina.com.br/thiago > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >