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); } On Wed, Nov 19, 2008 at 11:12 AM, 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] > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]