“
When you look at a class that says, well, if you add a new database, I have to modify these three functions, and if there is a new financial instrument, I have to modify these four functions. Then, it might be better to divide the class into two, so that each object can be modified for just one change. The name of the above feature is called: Divergent change. It says that a class often changes in different directions for different reasons. For example, the above class, for two reasons, can cause this class to change in two different directions. We think that a class can only change for one reason, which is good. If, for a variety of reasons, this class changes, then we are going to refactor this class. Find out all the changes in this class for some reason, distill this part into a new class, use the Extract class technique, and then the new class will only cause changes for one reason. For example, the above class, because of two different reasons, in different directions change, then, can be refined one of the causes of changes in the relevant code, as a new class. For example, a new database is added, resulting in a change, and this part of the code is distilled into the new Class A. In this way, the new class will only change for the reason of the database. Example: TBD.
Divergent change (divergent)---signal to be reconstructed