On Tue, Sep 2, 2008 at 23:49, Robert Burrell Donkin <[EMAIL PROTECTED]> wrote: > On Tue, Sep 2, 2008 at 10:32 PM, David Jencks <[EMAIL PROTECTED]> wrote: > > <snip> > >> FWIW although you have to supply some metadata (currently via code or >> annotations) Geronimo can construct components through constructor >> injection: there shouldn't be any problem constructing a maillet. >> >> I thought spring could too if you jumped through enough configuration hoops >> but I'm definitely not a spring expert. > > i've read that it can (spring is pretty flexible) > >> I am really really strongly in favor of constructor injection of final >> fields. > > i use that pattern a lot since it has good concurrency characteristics > though setter injection is much more popular > > (mailets should be protected by their container so this shouldn't be > such an issue in this case) > > IMHO the best approach for the mailets James ships would to be > agnostic and support both types of injection by providing appropriate > setters and constructors
I'm a lot fiddling around with designing beans these days and what I learned is that you have to decide which injection to use on a case-by-case basis. generally, SDI works pretty good, and I'd second that for final fields CDI is a first consideration. but there is no golden rule like XDI is always better than YDI. Bernd --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
