Hi Igor,

On 4/23/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > 1) not needing to run on Java 5 in order to have clean dependency
> > injection. (I don't consider commons-attributes a proper
> > workaround--just a personal bias, of course)
>
> this has nothing to do with java 5, you can just as easily inject fields as
> setters in java 1.4

True. You can technically inject fields just as well. I guess I was
thinking that I'd like to have a public setter rather than expose the
field as public. What I meant by the whole 1.4/5.0 thing was simply
not needing annotations.

Of course one could use reflection in unit tests as well but somehow I
like the setter being present more.


> > 2) being able to set dependencies in unit tests without involving a
> > mock Spring context.
>
> then you didnt read my response in that thread closely enough. the injection
> happens /before/ the constructor of the class executes. so calling setters
> w/out the injector present in unit tests is already too late because the
> constructor needs to have those dependencies.

Why would the constructor need those dependencies? Isn't this
dependent on how you implement your component?

-Lasse-


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to