Original Post
Hello all. Working on a large refactor as usual...
One of the biggest issues I deal with is what I call software rot.
Software with rot tends to be riddled with cross class dependencies,
too many [potentially stale] internal and external couplings.
Inconsistent data structures and threading models. Odd uses of friend
classes, etc.
It all comes to down to too much coupling. Personally I want to blame
logical coupling; however, that is just my bias against the current codebase
I'm working against...
We have a core set of classes that we reuse. For that matter... those classes
are contained in a few components that all our projects reuse. As we add
more abilities the classes tend to get larger and their concepts get muddled.
It finally gets to a point where responsibilities shift and an entire section
must be refactored. This is where I feel the rot comes in. One area gets
reconstructed with the abilities and paradigms--but it must maintain
compatibility with the rest of the code.
Internally we have to start building facades or end up with base classes
with dozens of methods and delegates; and/or, the logical dependencies
cause rippling bugs.
Each time a class/component is reused... the more the rot mutates it into
something other than what it was originally intended to be.
Obviously part of this comes down to the granularity of the classes. Small
classes tend to stay stabler longer; however, as each generation of the
software is developed--even the small classes tend to grow and grow.
One could make base classes so small that their abilities never change;
however, that only moves the problem. You would still end up with aggregate
classes either inherit or encapsulate dozens and dozens of children. This
itself adds coupling and complexity and ends up being a lot of typing to
tie the interfaces together.
I would like to start a discussion of general ways of coping with this
problem: anticipating and preventing rot in new projects, coping with
debugging and extending large systems already infected with rot, etc.
[Edited by - Mathucub on November 26, 2010 2:26:54 PM]
One of the biggest issues I deal with is what I call software rot.
Software with rot tends to be riddled with cross class dependencies,
too many [potentially stale] internal and external couplings.
Inconsistent data structures and threading models. Odd uses of friend
classes, etc.
It all comes to down to too much coupling. Personally I want to blame
logical coupling; however, that is just my bias against the current codebase
I'm working against...
We have a core set of classes that we reuse. For that matter... those classes
are contained in a few components that all our projects reuse. As we add
more abilities the classes tend to get larger and their concepts get muddled.
It finally gets to a point where responsibilities shift and an entire section
must be refactored. This is where I feel the rot comes in. One area gets
reconstructed with the abilities and paradigms--but it must maintain
compatibility with the rest of the code.
Internally we have to start building facades or end up with base classes
with dozens of methods and delegates; and/or, the logical dependencies
cause rippling bugs.
Each time a class/component is reused... the more the rot mutates it into
something other than what it was originally intended to be.
Obviously part of this comes down to the granularity of the classes. Small
classes tend to stay stabler longer; however, as each generation of the
software is developed--even the small classes tend to grow and grow.
One could make base classes so small that their abilities never change;
however, that only moves the problem. You would still end up with aggregate
classes either inherit or encapsulate dozens and dozens of children. This
itself adds coupling and complexity and ends up being a lot of typing to
tie the interfaces together.
I would like to start a discussion of general ways of coping with this
problem: anticipating and preventing rot in new projects, coping with
debugging and extending large systems already infected with rot, etc.
[Edited by - Mathucub on November 26, 2010 2:26:54 PM]