In addition to some sweet Inversion of Control injection action, Spring brings flowers and baby deer. And it brings some nice database connection help. Spring JdbcTemplate is a vanguard of strength and ease for connecting to your favorite RDBMS. And it so happens that the DBA I’m working with right now digs the stored procs. So, we’ll meet in the middle with some more goodness born of Spring.
In developing an email notification system recently, we became interested in code acting differently depending on what environment we were in. A potentially good solution for this is environment-based dependency injection. This means that different Spring beans, for instance, will be used depending on the environment, ie dev, test, etc. This is useful for something like emailing, because we may not want real emails hitting the mail server in dev or test environments, but we do in prod. With some Spring constructs, it’s pretty easy.