Spring autowiring
If you are using the Spring Java framework, here's some advice: don't use the autowiring feature.
Spring can be configured to autowire dependencies using introspection of the bean classes. This saves you from having to explicitly specify the bean properties and from specifying the constructor arguments. In theory, this sounds great. It saves you from some potential typing, it reduces the size and clutter of your XML Spring configuration files, and it reduces the chance that you'll miss something in the configuration. This makes for a great demo on how easy it is to use Spring and get up and running quickly.
But while it's great for a demo on a small project, it's far less useful on a real-world application. Without having the bean configurations laid-out explicitly, the maintainability of your project gets worse; the bigger your project gets, the harder it is to maintain.
Save yourself the trouble ahead of time. It takes a little longer to get things up and running, but in the long-term you'll be much better off if you turn off the autowiring capability in the Spring framework.
Spring can be configured to autowire dependencies using introspection of the bean classes. This saves you from having to explicitly specify the bean properties and from specifying the constructor arguments. In theory, this sounds great. It saves you from some potential typing, it reduces the size and clutter of your XML Spring configuration files, and it reduces the chance that you'll miss something in the configuration. This makes for a great demo on how easy it is to use Spring and get up and running quickly.
But while it's great for a demo on a small project, it's far less useful on a real-world application. Without having the bean configurations laid-out explicitly, the maintainability of your project gets worse; the bigger your project gets, the harder it is to maintain.
Save yourself the trouble ahead of time. It takes a little longer to get things up and running, but in the long-term you'll be much better off if you turn off the autowiring capability in the Spring framework.
| Rating: | no ratings, 0 total Votes |
| Categories: | Java spring programming xml |
| Added: | on Oct 01, 2007 at 10:59 am |
| Added By: | javaguy |

