Good methods for handling dependency changes are the same as effective methods for designing applications. You want to overlay your architecture and minimize the ubiquitous connection of your code with each dependency, in order to preserve isolated changes so that updating the dependency does not interrupt every part of your application. Code for interfaces and keep business logic separate from infrastructure code.
With minor updates (updating dependency dependency points) this helps if you have a complete set of unit tests to detect failures due to API changes. This is one of the main reasons why it sometimes helps to write trivial tests that seem always useful at first glance. An example of this is writing a simple JDBC unit test to perform a simple query. This seems like a waste of time until you catch the problem with the JDBC driver after updating the database (this happened to me).
For big changes (like upgrading between incompatible versions of a framework like Spring), this helps if you have some automated functional or integration tests, or at least have a functional specification that your QA staff can go through to check the high level level. Unit tests will most likely no longer matter if the infrastructure API you are updating is different enough to require wide code changes.
The actual tactical part of managing the transition from one version of the addiction to another incompatible really depends on what you are doing. A mature library will provide some kind of migration path and hopefully does not require you to rewrite everything. It is recommended to separate code changes associated with updating the infrastructure from changes related to the introduction of a new feature. Thus, if something breaks, you will find out that it is connected with updating the framework, and not with something that you violated when implementing the new function.
Part of what makes this so difficult is that at run time you can only have one version of a specific dependency in your JVM, so you need to update all the code right away. OSGi solves this problem by allowing different OSGi paths to work the same way to depend on different versions of dependencies, so you can depend on different versions of dependencies at runtime. So Eclipse manages dependencies for plugins without breaking other plugins.
Ken liu
source share