Anticipating Change: Make Quality Code that is Easier to Update.
May 19th, 2009
Accommodating changes is one of the most challenging aspects of good program design. The goal is to isolate unstable areas so that the effect of a change will be limited to one function, class, or package. That way if there is any changes needed it won’t effect surounding code.
Identify what is likely to change
Here are a few areas that might be likely to change.
- Business Rules Some examples might be an insurance company changing its rates structure, or a University changing how it grades students
- Input and Output User input is a very volatile area, and such is likely to change how your program might handle it.
- Difficult Design Areas There is a good chance that difficult areas might change simply because there is a good chance that there were mistakes made.
- Status Variables Error status might change because you might initially only need a boolean value, as the application gets more involved the error status might need to be changed into an array.
- Data Size Constraints An example might be MAX_EMPLOYEES
Compartmentalize each volatile item
In this step you should seperate the items that might change and place them into their own class or function. A good example of this is in the article Abstraction: Making Code Readable













