Jan 13th, 2010, 04:28 AM
Originally Posted by zzkhan
I tend to use annotations only to avoid the dependency of the mvc class itself. I still prefer the xml configuration since I find many places where a single controller class is configured differently for serving different cases. Furthermore this framework-independance allows me to have some base functionality classes that can be extended by my controllers no matter if they are SimpleForm or ParametrizableView style or whatever. Untill 2.5 I had to use some type of delegation pattern for these cases but no more...
I still believe though that new Spring users should have a look at the javadocs of the -now deprecated- controllers (especially AbstractFormController) to have a basic idea of how things are handled under the covers
Jan 14th, 2010, 08:28 AM
I concur with this point. Despite many peoples adversion to xml config (or any external config) I find it better to decouple from code as much as possible with frameworks and true config type data. Now, annotations that are part of the base language structure I use including ones that allow injection of Spring items. In addition, having all your config / injection in one place allows for easy knowledge of where a bean is used.
Originally Posted by Jabberz
Another place where I often 'violate' this standard is in JUnit tests where I annotate injection more to save on test specific config. At least so far that has not been a 'bad' thing.
Jan 14th, 2010, 02:38 PM