I am working with several Spring MVC web applications and I use the getter/setter dependency injection and configure all my beans in my app-servlet.xml file.
I believe that I am following convention with most of the properties and beans that I am injecting into my controller beans such as my DAO's and other beans that I have specified in either my applicationContext.xml or in the app-servlet.xml
As my applications have been getting more complex and larger, the beans in these files have been filling up with more properties that are being injected.
My question is, where is the line, or what is the convention on what should be injected, and what should be specified as an instance field/variable in the controller.
Sometimes I am faced with a situation if I am going to specify the value for a field in the actual controller, or if I am going to inject the value into that controllers bean.
For example, I am using velocity template library for sending my emails. There is a path to the directory of my Velocity Templates. I am faced with doing one of the following.
In my Controller I could specify the value
private String basePath = "/path/to/velocity/templates";
Or in my Controller bean I could inject the same value into that controller
<property name="basePath" value="/path/to/velocity/templates"/>
and in my class I would have the getters/setters for this injected value.
I am not sure where to draw the line for each.