I am the lead developer on a project whose continuing mission is the implementation, expansion, and maintenance of our highly trafficked site's content management system. The CMS is neither an in-house solution nor an open-source project - it is an expensive product purchased from a vendor. Unfortunately, it's a very... shall we say... enterprisey product.
To make a long back-story short, the product in its delivered state simply did not meet the company's technical requirements. The vendor designated a portion of the codebase that we could modify freely to implement our business requirements without changing the core product and losing the ability to upgrade to new versions easily; however, due to the nature of core product's codebase (very tight coupling, no DI, singletons everywhere, lots of "magic"), there was simply no way to implement our requirements (and fix their bugs) without "voiding our warranty", so to speak, and hacking away at the core application.
So, essentially:
- We can't make this product work the way we need it to work without hacking away at the core system.
- We can't hack away at the core system without compromising our ability to seamlessly upgrade to new versions of the vendor's product.
- We are stuck with the product and cannot abandon upgradability.
- GOTO 1
We cannot possibly be the only team that has faced this dilemma... what are some strategies you have used in the past to modify third party code to suit your needs while still being able to upgrade to their new versions as time goes on?
What I've done thus far is the following:
- Create unit tests (when possible - and its often not possible without an impractical amount of refactoring) for the behavior that has changed.
- Do as much of the modification in designated "customer area" of the codebase as possible, when possible.
- Created an SVN vendor branch of the initial, unmodified application to be used to merge in the new versions.
Vendor branches will only guarantee that we will know which changes to apply, but they won't help us at all with the nightmare of conflicts we're likely to encounter.
What else, if anything, can we do now to ease the pain later?