Hardening of the architecture

Hardening of the architecture happens when you keep making incremental changes to an existing class. If it doesn't quite handle a situation, someone adds a tweak. When the next problem comes up, another tweak is added. Or when a new feature is requested, another tweak is added, and so on.

One of the most important skills you can develop is a little red warning light inside your head that causes you to think, "Wait a minute, this is starting to get messy." When your class gets convoluted, it's time to reexamine the design. Here are some of the warning signs that the time has arrived:

There are bugs because the internal state of an object is too hard to track and fixes consist of adding patches. Patches are characterized by code that looks like: "If this is the case, then force that to be true," or "Do this just in case we need to," or "Do this before calling that function, because it expects this."

There are member functions that do not fit in very well with the class definition.
(See
"Object bloat" and "Lost object focus" on page 49.)


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker