views:

33

answers:

1

I have 3 class libraries. A BBL, a DAL, and a DATA (about 15 datasets). Currently 4 [major] applications utilize the functionality in these DLL's. I'm rewriting one of those applications and I need to (1) Use some of the existing functionality in the libraries (2) Change some of it (3) Add new functionality (4) Add new datasets.

I'm back and forth about the best way to do this, while keeping my risks at a minimum. Some thoughts..

1) Use the existing projects and don't make any modifications, only additions 2) Make new libraries, bring over the code I can use, and make additions as needed 3) Implement partial classes in the existing projects

Eventually all 4 applications will use the newest functionality, but it will be a slow migration; so the old code can't be depricated yet.

Any thoughts?

A: 

You're being very general here (that's probably why you haven't received any answers yet). This is a typical real-world example of rewriting/refactoring code while maintaining compatibility with its surroundings. There is no easy answer to your question, but a few points spring to mind:

  • Write tests for the code you're about to refactor/rewrite, if there aren't any to start with. This will enable you to verify that you're not breaking things as you go along.
  • Work in small increments. Try to avoid rewriting everything at once. Run your tests and commit often.
  • Use a Continuous Integration server such as Hudson to build and test everything automatically for you.
JesperE