I realized that a good side effect of using spring in your application is that you are always creating public setter/getter(optional) for your dependencies and sometimes "init" and "destroy" methods.
Lot of times in production we had to change some settings like list of memcache servers(when you add/remove a one) or list of cassandra servers(when you move them around to better hardware). The problem is that we want to avoid as much tomcat restarts when this happens as some of these are global to all tomcats and we cant restart all of them(it has to be a rolling restart). With spring its easy, you can always write a jsp that can call the setter and change the setting on the live bean and you are done.
In traditional applications where you don't use spring its entirely up to developers to expose the setter method but with spring this nice side effect has save my ass a lot of time.
Lot of times in production we had to change some settings like list of memcache servers(when you add/remove a one) or list of cassandra servers(when you move them around to better hardware). The problem is that we want to avoid as much tomcat restarts when this happens as some of these are global to all tomcats and we cant restart all of them(it has to be a rolling restart). With spring its easy, you can always write a jsp that can call the setter and change the setting on the live bean and you are done.
In traditional applications where you don't use spring its entirely up to developers to expose the setter method but with spring this nice side effect has save my ass a lot of time.
Comments
Post a Comment