On Tue, 15 Oct 2013 19:18:51 -0300, Martin Kersten <martin.kersten...@gmail.com> wrote:

And If I remember my diggin into the code session of tapestry's IOC
correctly, binding a concrete (implementation) class is just binding the
class to all its (super)interfaces. The only way of getting something
concrete out of tapestries registry is using the autobuild,

Nope, that's not correct at all.

public interface Service {
        public String method(String string);
}

public class ServiceImpl implements Service {
        public String method(String string) {
                return null;
        }
}

public class TestModule {
        public static void bind(ServiceBinder binder) {
                binder.bind(ServiceImpl.class);
        }
}

RegistryBuilder builder = new RegistryBuilder();
builder.add(TestModule.class);
final Registry build = builder.build();
final ServiceImpl service = build.getService(ServiceImpl.class);
System.out.println(service.getClass().getName());

The lines above print "method_advice.ServiceImpl" (all classes here are in the method_advice package).

That was tested in Tapestry-IoC 5.3.6 and 5.4-alpha-22, so you've been complaining without reason (except for the annotations-in-service-interface-methods, but that will be fixed soon).

You have to annotate the interface to describe an implementation detail. Wow that is really good OOP to the max (sarcasm intended).

This is a known limitation which bugs me a awful lot (just check the mailing list archives) and it's in my plans to fix it myself: https://issues.apache.org/jira/browse/TAP5-2029

Would be way better then this interface heavy IOC.

OOP good practices are interface-heavy, so is IoC.

What is about creating a service using a builder method? This should at
least selectively avoids the reload classloader thing, right?

Service class reloading is disabled by setting the tapestry.production-mode symbol, something I've said before in this same thread, to false or calling binder.bind(***).preventReloading().

Case closed. :D

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to