Hi Johan, On 4/23/06, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > 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. > > why would you expose the field as public? That is not needed with reflection > Reflection can by pass all scopes. And set private fields just as easy.
Because then I wouldn't need to do any reflection magic in the unit test. (yes, the reflection could be hidden into a utility method, but still) > > Why would the constructor need those dependencies? Isn't this > > dependent on how you implement your component? > > because pretty much everybody is doing the initializing of the component in > the constructor. > So it is very handy to have all the injected objects there. Ok. This is where my newbieness with Wicket got me. I didn't know that people typically use the component's dependencies in their constructors. -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