That might work in some cases yes. The case I'm looking at right now is a service that returns a list of objects, where the objects are produced by some other framework on the fly. So I need to inject dependencies into these objects before returning them from my service method. Some code:
public class MyActionsProvider { public Action[] getActions() { return Utilities.getActionsForPath("my/path/here") } } The dependencies for these objects are theoretically unknown, either way potentially a lot of dependencies, so not very nice injecting them all into my service and very clumsy invoking setters for each Action. So there doesn't exist an exposed API in tapestry for finding setters that match services by type and invoke them runtime on non-tapestry-managed instances? On Mon, Aug 13, 2012 at 2:18 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 13 Aug 2012 09:13:50 -0300, Inge Solvoll <inge.tapes...@gmail.com> > wrote: > > Hi! >> > > Hi! > > Why don't you declare these objects as Tapestry-IoC services using a build > method in your module class? > > SomeClass buildSomeClass(Dependency1 dependency1, Dependency2 dependency2) > { > SomeClass object = ...; // get the object somehow. > object.setDependency1(**dependency1); > object.setDependency2(**dependency2); > return object; > } > > -- > Thiago H. de Paula Figueiredo > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@tapestry.**apache.org<users-unsubscr...@tapestry.apache.org> > For additional commands, e-mail: users-h...@tapestry.apache.org > >