I started converting a small project from hivemind to tapestry-ioc,

this was just to compare experiences...

most of it went fine, but when it came to auto-wiring, it got
overcomplicated.

auto-wiring works for parameters in module's build-methods,
but this still means that I have to manually construct the service
and set the dependencies provided in build method parameters.

for example:
  public ICronService buildCron(
     RegistryShutdownHub hub,
     UserService userService,
     Log log,
  ){
       CronService cron = new CronService(hub, userService, log);
       cron.start();
       return cron;
  }

this could be shorter (provided that container creates instance nad
autowires properties)

  public ICronService buildCron(CronService cron){
       cron.start();
       return cron;
  }


the problem here is not in ammout of writing
(the latter code is little confusing also)
the problem lies in the fact that if I add another dependancy:
- create field
- create setter
this was enough in hivemind, but in tapestry-ioc
I have to change the build method:
- add an extra parameter
- call the setter

any thoughts on this ?
any plans ?

Davor Hrg

Reply via email to