ABSTRACT

In our constant quest for software quality, consistent interfaces and modular code are very important. In light of this, we need to turn our attention on get

and

set

. If you examine the current implementations of

get

or

set

, the logic in almost every case statement is different. These differences are currently necessary because the interface for each public variable is unique. It is preferable to keep the group-of-eight functions as uniform as possible and that means trying to move interface differences out of get

and

set

. There isn’t a lot we can do about individual cases, but we can simplify the code contained in each. To do this we will develop a helper-function technique that pushes most of the differences out of get

and

set

and into the helper. This technique will improve code modularity and improvements in modularity directly relate to improvements in code quality.